aKode 0.5.0: riepilogo della memoria a inizio sessione, sollecito alle azioni annunciate, daemon allineato al CLI
- ext/memoria: legge una volta per sessione la risorsa memoria://briefing (file di git status, budget di token, timeout breve), accetta solo un blocco <memoria_briefing> chiuso e limitato, lo inserisce dopo le istruzioni del plugin e lo tiene in cache per il thread (prefisso del prompt stabile). Impostazioni [memoria] briefing, briefing_timeout_ms, briefing_max_tokens. - Turno: se il modello chiude con un messaggio che annuncia un'azione senza chiamare strumenti, un solo sollecito per turno ([agent] announce_nudges, predefinito 1, 0 lo disattiva), con avviso visibile e test sui messaggi osservati con Qwen. - Daemon: sync_with_cli confronta l'eseguibile del CLI con il pacchetto del daemon e, se diverso, lo seleziona e riavvia solo quando non ci sono sessioni caricate; altrimenti avviso. Usato all'avvio della TUI, da `akode update`, da install.sh e da `akode app-server daemon update --from-cli --if-idle`. Prima un daemon preparato una volta restava alla versione vecchia (CLI 0.4.0 con app server 0.3.1). - Test: snapshot del doctor indipendenti dalla versione; snapshot della TUI aggiornati alla 0.5.0 e allo schema dei tool appiattiti della 0.4.0. - Versione 0.5.0 e sezione Novità nel README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -499,6 +499,8 @@ pub(crate) async fn run_turn(
|
||||
|
||||
let mut last_agent_message: Option<String> = None;
|
||||
let mut stop_hook_active = false;
|
||||
// Reminders sent this turn for announced-but-not-executed actions (`[agent] announce_nudges`).
|
||||
let mut announce_nudges_sent: u32 = 0;
|
||||
// Although from the perspective of codex.rs, TurnDiffTracker has the lifecycle of a Task which contains
|
||||
// many turns, from the perspective of the user, it is a single turn.
|
||||
let turn_diff_tracker = Arc::new(tokio::sync::Mutex::new(
|
||||
@@ -792,6 +794,48 @@ pub(crate) async fn run_turn(
|
||||
}
|
||||
}
|
||||
|
||||
if !needs_follow_up
|
||||
&& announce_nudges_sent < turn_context.config.announce_nudges
|
||||
&& sampling_request_last_agent_message
|
||||
.as_deref()
|
||||
.is_some_and(super::announce_nudge::looks_like_unexecuted_announcement)
|
||||
&& let Some(nudge) = build_hook_prompt_message(
|
||||
&[akode_protocol::items::HookPromptFragment {
|
||||
text: super::announce_nudge::NUDGE_TEXT.to_string(),
|
||||
hook_run_id: super::announce_nudge::NUDGE_ID.to_string(),
|
||||
metadata: akode_protocol::models::ContentItemMetadata::harness(),
|
||||
}],
|
||||
&sess.item_id_generator,
|
||||
)
|
||||
{
|
||||
announce_nudges_sent += 1;
|
||||
tracing::info!(
|
||||
turn_id = %turn_context.sub_id,
|
||||
nudges = announce_nudges_sent,
|
||||
"akode: turn ended on an announced action without a tool call; nudging the model"
|
||||
);
|
||||
sess.send_event(
|
||||
&turn_context,
|
||||
EventMsg::Warning(WarningEvent {
|
||||
message: "Il modello ha annunciato un'azione senza eseguirla: aKode lo sollecita una volta.".to_string(),
|
||||
}),
|
||||
)
|
||||
.await;
|
||||
sess.record_response_item_and_emit_turn_item(
|
||||
&turn_context,
|
||||
&step_context.settings.model_info,
|
||||
nudge,
|
||||
)
|
||||
.await;
|
||||
sess.input_queue
|
||||
.accept_mailbox_delivery_for_current_turn(
|
||||
&sess.active_turn,
|
||||
&turn_context.sub_id,
|
||||
)
|
||||
.await;
|
||||
continue;
|
||||
}
|
||||
|
||||
if !needs_follow_up {
|
||||
last_agent_message = sampling_request_last_agent_message;
|
||||
let stop_outcome = run_turn_stop_hooks(
|
||||
|
||||
Reference in New Issue
Block a user