hive-runtime: replace the session when an ACP compact command fails
A `compact` command that errors, or sends nothing, used to leave the session as full as before: `compacted` stayed false, so every following turn ran the checkpoint and another `/compact` again, each one waiting out the 600s turn idle window when the command was silent. - The `/compact` turn gets its own idle bound, COMPACT_IDLE (3 min, or the turn's idle window if shorter), through the turn's existing watchdog, so a silent command is cancelled (or killed) like any stalled turn. - When the command fails or hits that bound, compaction falls back to the no-command path: the session is archived and the next turn starts a new one. The checkpoint turn runs there only if it has not already run in this compaction. - Compaction returns early when attaching produced a new session (a failed `session/load` or a never-answered first prompt): there is nothing in it to compact. Refs #4391
This commit is contained in:
parent
cec35bfbb1
commit
b8ec0f4f85
2 changed files with 85 additions and 12 deletions
|
|
@ -52,3 +52,7 @@ past the watermark, or on `compact` (the operator's `/compact`, the agent's
|
|||
checkpoint turn first, as on claude.
|
||||
- Otherwise the policy's checkpoint turn runs, then the session is archived,
|
||||
and the next turn starts a new one, carrying the system prompt again.
|
||||
- A `compact` command that fails, or sends nothing for 180s (the turn's idle
|
||||
window if that is shorter), is cancelled and handled as the case above; the
|
||||
checkpoint turn is not run a second time. So a compaction always leaves a
|
||||
smaller session behind, and a failed one is not retried on the next turn.
|
||||
|
|
|
|||
Loading…
Reference in a new issue