From 604bf389b60e1966b10b43ec22719828da8a28d5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 25 Apr 2026 07:48:22 +0900 Subject: [PATCH] =?UTF-8?q?roadmap:=20#203=20filed=20=E2=80=94=20AutoCompa?= =?UTF-8?q?ctionEvent=20summary-only,=20no=20SSE=20event=20emitted=20mid-t?= =?UTF-8?q?urn=20when=20auto-compaction=20fires=20(Jobdori=20cycle=20#136)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ROADMAP.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ROADMAP.md b/ROADMAP.md index a8cf771..e64ea7c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -12380,3 +12380,42 @@ grep -rE 'kind:.*=' src/ | grep -v test | wc -l **Status:** Open. No code changed. Filed 2026-04-25 06:09 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: 5e0228d. 🪨 + +--- + +## Pinpoint #203 — `AutoCompactionEvent` is summary-only: no streaming SSE event emitted when auto-compaction fires mid-turn (Jobdori, cycle #136) + +**Observed:** In `rust/crates/runtime/src/conversation.rs`, `maybe_auto_compact()` (line ~555) fires compaction between turns and returns an `AutoCompactionEvent { removed_message_count }`. This event is attached to `TurnSummary.auto_compaction` and only surfaces in the post-turn struct returned by `run_turn()`. It is not emitted as a streaming SSE event at the moment compaction occurs. + +**Gap:** +- A claw monitoring the SSE stream during a long multi-turn session cannot detect that compaction fired until the final `TurnSummary` JSON arrives (or, in JSON output mode, until the CLI prints the final response envelope) +- Between compaction firing and the final summary, the session history has already been truncated — any mid-turn state the claw was tracking against the old history is now stale +- No `session_compacted` or `auto_compaction` SSE event exists; the classifier's event taxonomy has no entry for it +- `claw doctor` cannot surface "this session has been auto-compacted N times" or "compaction removed M messages in the last turn" +- Claws relying on replay-by-session-history for context reconstruction silently receive a shorter history with no notification + +**Repro:** +``` +# Run a session long enough to trigger auto-compaction +# Monitor the SSE stream during the turn +# Observe: no event with kind=session_compacted or similar appears in the stream +# The only signal is the post-turn auto_compaction field in the JSON summary +# If running in interactive TUI mode, the only signal is the printed compaction notice +``` + +**Expected:** +- When `maybe_auto_compact()` removes messages, emit a streaming SSE event immediately: `{ "kind": "session_compacted", "removed_message_count": N, "retained_message_count": M, "trigger": "auto" }` +- `claw doctor` surfaces sessions with auto-compaction history and message counts +- Classifier recognizes `session_compacted` as a first-class event kind +- `/compact` manual command similarly emits this event (currently only prints a user-facing string) + +**Fix sketch:** +1. Add `session_compacted` to the `StreamEvent` enum (or as a diagnostic event channel alongside it) +2. In `maybe_auto_compact()`, after compaction, push `session_compacted` event through the event channel before continuing the turn +3. Expose count in the event: `{ kind: "session_compacted", removed_message_count: N }` +4. Wire manual `/compact` command to emit the same event +5. Add to classifier event taxonomy and `claw doctor` output + +**Status:** Open. No code changed. Filed 2026-04-25 07:47 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: 0730183. + +🪨