aKode 0.2.0: protezione dai loop, errori del server chiari, pulizia
- Protezione dai loop: se il modello ripete lo stesso comando con lo stesso errore 3 volte di fila il turno si ferma con un messaggio chiaro (e un suggerimento su /permissions per i blocchi della sandbox); configurabile con [agent] max_repeated_failures (0 = disattivata). - Errori dello stream: si mostra il messaggio del server invece di "stream closed before response.completed"; il contesto superato (llama.cpp, vLLM) diventa un messaggio in italiano; avviso una volta se il prompt iniziale supera la finestra del modello. - Pulizia: tolta la logica morta per le chiavi OpenAI nel credential broker (prefisso "sk-", watermark, prefissi ignorati); link alla documentazione OpenAI nella TUI sostituiti con il README del repository; test dello snapshot del broker adattato al token GitHub. - Versione 0.2.0 e sezione Novità nel README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -692,6 +692,9 @@ pub enum ThreadStoreConfig {
|
||||
InMemory { id: String },
|
||||
}
|
||||
|
||||
/// Default for `[agent] max_repeated_failures`.
|
||||
pub const DEFAULT_MAX_REPEATED_FAILURES: u32 = 3;
|
||||
|
||||
/// Application configuration loaded from disk and merged with overrides.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Config {
|
||||
@@ -1218,6 +1221,10 @@ pub struct Config {
|
||||
/// Default: `300000` (5 minutes).
|
||||
pub background_terminal_max_timeout: u64,
|
||||
|
||||
/// Loop protection: stop the turn after this many identical failed tool calls in a row
|
||||
/// (`[agent] max_repeated_failures`). `0` disables the check.
|
||||
pub max_repeated_failures: u32,
|
||||
|
||||
/// Idle timeout for unsubscribed app-server threads.
|
||||
pub thread_unload_delay: Duration,
|
||||
|
||||
@@ -4213,6 +4220,11 @@ impl Config {
|
||||
.as_ref()
|
||||
.and_then(|agents| agents.interrupt_message)
|
||||
.unwrap_or(true);
|
||||
let max_repeated_failures = cfg
|
||||
.agent
|
||||
.as_ref()
|
||||
.and_then(|agent| agent.max_repeated_failures)
|
||||
.unwrap_or(DEFAULT_MAX_REPEATED_FAILURES);
|
||||
let background_terminal_max_timeout = cfg
|
||||
.background_terminal_max_timeout
|
||||
.unwrap_or(DEFAULT_MAX_BACKGROUND_TERMINAL_TIMEOUT_MS)
|
||||
@@ -4814,6 +4826,7 @@ impl Config {
|
||||
tool_registry,
|
||||
code_mode,
|
||||
background_terminal_max_timeout,
|
||||
max_repeated_failures,
|
||||
thread_unload_delay,
|
||||
ghost_snapshot,
|
||||
multi_agent_v2,
|
||||
|
||||
Reference in New Issue
Block a user