aKode 0.9.1: correzioni dalla prova di Fourier (apply_patch, write_file, errori visibili, rete dei pacchetti)

- apply_patch tollerante: aggiunge '*** Begin Patch'/'*** End Patch' mancanti quando
  il contenuto inizia con Add/Update/Delete File, toglie i recinti ```; ogni altra
  ambiguità resta un errore; riga con il formato e un esempio negli errori di formato.
- Strumento write_file (path + contenuto) sulla pipeline di apply_patch (stesse
  verifiche, sandbox, approvazioni e hook), [tools] write_file (predefinito attivo);
  dopo la scrittura ricorda al modello di verificare il file.
- Chiamate a strumento fallite visibili nella TUI ("✗ strumento: motivo · riprovo").
- Avanzamento mentre il modello scrive una chiamata lunga ("Scrivo file · N token")
  e stato del gateway imeAI ("In coda…", "Leggo il prompt · 42%").
- write_stdin con id inesistente: elenca le sessioni aperte e indica exec_command o
  write_file; descrizione più chiara.
- Protezione dai loop: un avviso al modello prima di fermare il turno.
- Sandbox predefinita: rete attiva solo verso i registri dei pacchetti attraverso il
  proxy di rete ([features.network_proxy] nei default impacchettati); scritture
  invariate; nota al modello sugli errori di rete in sandbox.
- Testi della TUI in italiano (benvenuto, segnaposto, suggerimenti, «Errore fatale»).
- Test adattati ai nuovi default (rete del profilo :workspace, allowlist), snapshot e
  schemi rigenerati.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-16 23:01:42 +01:00
parent 1c278642de
commit 3df68b5842
282 changed files with 2750 additions and 707 deletions

View File

@@ -225,7 +225,7 @@ pub enum CodexErrorDetails {
/// Gateway credentials require user action before requests can resume.
#[error("{0}")]
GatewayLoginRequired(String),
#[error("Fatal error: {0}")]
#[error("Errore fatale: {0}")]
Fatal(String),
// -----------------------------------------------------------------
// Automatic conversions for common external error types

View File

@@ -1701,6 +1701,12 @@ pub enum EventMsg {
/// Latest model-generated structured changes for an `apply_patch` call.
PatchApplyUpdated(PatchApplyUpdatedEvent),
/// aKode: the model is still generating the arguments of a tool call.
ToolCallInputProgress(ToolCallInputProgressEvent),
/// aKode: a local server is queueing the request or reading the prompt.
ServerProgress(ServerProgressEvent),
/// Notification that a patch application has finished.
PatchApplyEnd(PatchApplyEndEvent),
@@ -4084,6 +4090,35 @@ pub struct PatchApplyUpdatedEvent {
pub changes: HashMap<PathBuf, FileChange>,
}
/// aKode: progress of a tool call whose arguments are still streaming from the
/// model (e.g. a whole file inside `apply_patch`), so clients can show that the
/// model is writing instead of looking stuck.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct ToolCallInputProgressEvent {
/// Identifier of the tool call being generated.
pub call_id: String,
/// Name of the tool.
pub tool_name: String,
/// File or target recognized in the partial arguments, if any.
pub target: Option<String>,
/// Approximate number of argument tokens generated so far.
pub tokens: u64,
}
/// aKode: progress reported by a local server before generation starts (imeAI
/// gateway): waiting in the queue or reading the prompt.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct ServerProgressEvent {
/// `queue` or `prefill`.
pub kind: String,
/// Prompt read so far, 0-100 (prefill).
pub percent: Option<f64>,
/// Estimated seconds left.
pub eta_s: Option<f64>,
/// Requests ahead in the queue.
pub ahead: Option<u64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct PatchApplyEndEvent {
/// Identifier for the PatchApplyBegin that finished.