mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
agent+acp: preserve session on retriable agent errors (#544)
This commit is contained in:
@@ -1157,8 +1157,12 @@ pub async fn run_prompt_task(
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!(target: "pool::prompt", "session_prompt error: {e}");
|
||||
// Invalidate only the affected session.
|
||||
agent.state.invalidate(&source);
|
||||
// AgentError means the agent caught a problem before mutating
|
||||
// session state (e.g. bad LLM response). The session is healthy —
|
||||
// don't invalidate it. Other errors may have corrupted state.
|
||||
if !matches!(e, AcpError::AgentError(_)) {
|
||||
agent.state.invalidate(&source);
|
||||
}
|
||||
let _ = result_tx.send(PromptResult {
|
||||
agent,
|
||||
source,
|
||||
|
||||
Reference in New Issue
Block a user