Log completed assistant node after parser finishes
The parser mutates the AST directly but doesn't write to the conversation log. The turn loop now logs the completed assistant branch after the parser handle resolves successfully. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
5f5a8a807c
commit
88ac5e10ce
1 changed files with 9 additions and 1 deletions
|
|
@ -362,7 +362,15 @@ impl Agent {
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
Err(e) => return Err(anyhow::anyhow!("parser task panicked: {}", e)),
|
Err(e) => return Err(anyhow::anyhow!("parser task panicked: {}", e)),
|
||||||
Ok(Ok(())) => {}
|
Ok(Ok(())) => {
|
||||||
|
let node = agent.context.lock().await.conversation()[branch_idx].clone();
|
||||||
|
let st = agent.state.lock().await;
|
||||||
|
if let Some(ref log) = st.conversation_log {
|
||||||
|
if let Err(e) = log.append_node(&node) {
|
||||||
|
eprintln!("warning: failed to log assistant response: {:#}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty response — nudge and retry
|
// Empty response — nudge and retry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue