loopd: background ToolSummary for opted-in results
Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
@@ -149,14 +149,22 @@ pub fn finish_turn(
|
||||
outcome: Result<TurnOutcome, TurnError>,
|
||||
) -> Result<TurnOutcome, TurnError> {
|
||||
match outcome {
|
||||
Err(TurnError::SessionFull) => match compact_session(session, rt, memory) {
|
||||
Ok(()) => run_turn(session, rt, text, speaker, on_event),
|
||||
Err(e) => {
|
||||
log_compact(session, &e);
|
||||
Err(TurnError::SessionFull)
|
||||
Err(TurnError::SessionFull) => {
|
||||
if let Err(e) = crate::summarise::missing(rt.cfg, rt.client, session) {
|
||||
eprintln!("loopd: tool summary: {e}");
|
||||
}
|
||||
},
|
||||
match compact_session(session, rt, memory) {
|
||||
Ok(()) => run_turn(session, rt, text, speaker, on_event),
|
||||
Err(e) => {
|
||||
log_compact(session, &e);
|
||||
Err(TurnError::SessionFull)
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(done) => {
|
||||
if let Err(e) = crate::summarise::missing(rt.cfg, rt.client, session) {
|
||||
eprintln!("loopd: tool summary: {e}");
|
||||
}
|
||||
if let Some(usage) = session.last_usage()
|
||||
&& due(&usage, rt.cfg.compact.threshold, rt.cfg.expect.n_ctx)
|
||||
&& let Err(e) = compact_session(session, rt, memory)
|
||||
|
||||
Reference in New Issue
Block a user