You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #63 (merged in #65). Two known, non-blocking edges deferred at merge time, plus the broader durability direction. Neither is reachable as a correctness bug today; this issue tracks them so they don't live only in PR review.
1. started with no done leaves compaction.active = true indefinitely
amux/context_compaction_started flips compaction_state.active = true; only a matching amux/context_compaction_done clears it. If Hermes crashes or is killed mid-compaction (or the done stderr line is dropped under flood — see lossy-pump note in src/agent/process.rs), active stays true until the next done or an amux restart.
Impact: cosmetic — a stuck "compacting…" indicator in session/attach snapshots and /debug/sessions. No count or segment corruption.
Self-heals: next done, or restart (hydration rebuilds from the persisted log).
Possible fix: clear active (a) when a turn settles, (b) on agent death/AgentDied, or (c) after a bounded timeout. Option (b) is probably the cleanest signal — a compaction can't still be in flight once the child is gone.
2. Future double-rotation when Hermes ships _meta.hermes AND stderr is enabled
Today only the stderr scraper rotates segments for Hermes compaction (Hermes doesn't emit _meta.hermes yet, so detect_segment_signal_from_agent_notification is dormant). When Hermes starts shipping structured _meta.hermes.sessionProvenance, both detectors could fire for the same compaction.
Risk: a spurious extra segment (stderr rotates to seg-N+1 with the old hermes session id in provenance, then the stdout metadata observes a new hermes id and rotates again to seg-N+2).
Direction: when structured signals land, gate the stderr scraper off (or make it a labeled fallback). The source: "hermes_stderr" field on amux/context_compaction_* already exists to distinguish the two paths. The robust long-term fix is Hermes emitting a machine-readable compaction/head-change signal so we stop scraping logs entirely.
3. (Context) stderr/stdout ordering is racy by construction
Not action-required, recorded for completeness. The done line (stderr) and post-compaction frames (stdout) feed one mpsc from two tasks, so a couple of frames adjacent to the boundary can land in the neighbor segment. Bounded, no frame loss/corruption, and already de-risked by the cross-segment turn-bookend carry logic. The structured-metadata path (item 2) rotates inline and exact, which is the real resolution.
Follow-up to #63 (merged in #65). Two known, non-blocking edges deferred at merge time, plus the broader durability direction. Neither is reachable as a correctness bug today; this issue tracks them so they don't live only in PR review.
1.
startedwith nodoneleavescompaction.active = trueindefinitelyamux/context_compaction_startedflipscompaction_state.active = true; only a matchingamux/context_compaction_doneclears it. If Hermes crashes or is killed mid-compaction (or thedonestderr line is dropped under flood — see lossy-pump note insrc/agent/process.rs),activestaystrueuntil the nextdoneor anamuxrestart.session/attachsnapshots and/debug/sessions. No count or segment corruption.done, or restart (hydration rebuilds from the persisted log).active(a) when a turn settles, (b) on agent death/AgentDied, or (c) after a bounded timeout. Option (b) is probably the cleanest signal — a compaction can't still be in flight once the child is gone.2. Future double-rotation when Hermes ships
_meta.hermesAND stderr is enabledToday only the stderr scraper rotates segments for Hermes compaction (Hermes doesn't emit
_meta.hermesyet, sodetect_segment_signal_from_agent_notificationis dormant). When Hermes starts shipping structured_meta.hermes.sessionProvenance, both detectors could fire for the same compaction.compaction_countonly increments on the stderrdone; the stdout_meta.hermespath rotates segments but never touches the count. Verified intentional (issue Capture Hermes stderr compaction signals and expose AMUX events #63 acceptance criterion).source: "hermes_stderr"field onamux/context_compaction_*already exists to distinguish the two paths. The robust long-term fix is Hermes emitting a machine-readable compaction/head-change signal so we stop scraping logs entirely.3. (Context) stderr/stdout ordering is racy by construction
Not action-required, recorded for completeness. The
doneline (stderr) and post-compaction frames (stdout) feed one mpsc from two tasks, so a couple of frames adjacent to the boundary can land in the neighbor segment. Bounded, no frame loss/corruption, and already de-risked by the cross-segment turn-bookend carry logic. The structured-metadata path (item 2) rotates inline and exact, which is the real resolution.Related
amux/session_head_changedprojection (the structured-signal future referenced above)