track compacted turns separately in stats

This commit is contained in:
damocles 2026-05-20 19:38:29 +02:00 committed by Mara
parent fceab658f4
commit 5951758b35
3 changed files with 23 additions and 11 deletions

View file

@ -186,7 +186,7 @@ async fn serve(
// Ack only on a clean turn-end; Failed / RateLimited leave
// the popped ids in-flight for the next boot's requeue.
// Mirrors hive-ag3nt; see that loop for full rationale.
if matches!(outcome, turn::TurnOutcome::Ok) {
if matches!(outcome, turn::TurnOutcome::Ok | turn::TurnOutcome::Compacted) {
ack_turn(socket).await;
}
// Rate-limited: park until the quota resets, then requeue
@ -378,6 +378,7 @@ fn build_row(
};
let (result_kind, note) = match outcome {
turn::TurnOutcome::Ok => ("ok", None),
turn::TurnOutcome::Compacted => ("compacted", None),
turn::TurnOutcome::PromptTooLong => ("prompt_too_long", None),
turn::TurnOutcome::RateLimited => ("rate_limited", None),
turn::TurnOutcome::Failed(e) => ("failed", Some(format!("{e:#}"))),