From 5ee9a00d56bccc8b5fa9bf55c10f0c656b1a4f50 Mon Sep 17 00:00:00 2001 From: Yeachan-Heo Date: Sun, 26 Apr 2026 10:30:34 +0000 Subject: [PATCH] roadmap: #289 filed --- ROADMAP.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ROADMAP.md b/ROADMAP.md index 161ced6..0b23fa3 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -17263,3 +17263,15 @@ Gap. Error paths do not share the success JSON envelope contract. Context-window Required fix shape: (a) make `--output-format json` emit structured error envelopes for `RuntimeError`/provider errors, preserving `kind`, `failure_class`, `message`, `session_id`, `session_file`, `model`, trace/request id, token estimates, and recovery commands; (b) include an `auto_compaction` decision object on failure with `attempted`, `phase`, `threshold`, `estimated_session_tokens`, `skip_reason`, and `retry_attempted`; (c) include the resolved managed session file path in text and JSON context-window recovery output; (d) add an orchestrator-safe `recommended_command` that uses the exact path/id; (e) regression-test `claw --output-format json prompt ...` with a synthetic context-window error to prove the output is parseable JSON and contains the recovery receipt. Acceptance: context-window/session-break failures are machine-readable and tell both humans and claws exactly what happened and what session artifact to repair. **Status:** Open. No source code changed. Filed 2026-04-26 19:03 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `9b06c98` before filing. Cluster delta: session-continuity-auto-compaction-semantics 1→2 (#287 trigger timing + #288 failure-envelope/recovery receipt). Concrete delta this cycle: ROADMAP-only pinpoint appended from JSON/error recovery audit. + +## Pinpoint #289 — Manual `/compact` reports every no-op as “session below compaction threshold” because `CompactionResult` has no skip reason or token/removability diagnostics + +Dogfooded 2026-04-26 19:32 KST while following the session-continuity / auto-compaction complaint cluster. Static audit shows both live REPL `/compact` and resumed `claw --resume ... /compact` treat `removed_message_count == 0` as `skipped` and call `format_compact_report(removed, kept, skipped)`. That formatter always says `Reason session below compaction threshold`. The underlying `compact_session` returns only `{ summary, formatted_summary, compacted_session, removed_message_count }`; it does not say why compaction was skipped. `should_compact` can return false because the compactable message count is not greater than `preserve_recent_messages`, because compactable estimated tokens are below `max_estimated_tokens`, because an existing compacted summary leaves too little compactable prefix, or because the caller used different configs (`/compact` uses default max 10k; resumed `/compact` uses max 0). None of that is surfaced. + +Concrete failure mode: after a context-window/session-maintenance failure, a user follows the suggested `/compact` recovery. If compaction removes 0 messages, Claw always reports “session below compaction threshold” even when the real reason may be “only recent tail remains,” “already compacted,” “tool-use/tool-result boundary prevents safe removal,” or “manual vs resume compact used a different threshold.” The user still has a broken large session but no explanation of why the recovery command did not reduce it. + +Gap. Compaction lacks diagnostic receipts: input message count, compactable prefix length, preserved tail size, estimated compactable tokens, configured threshold, existing-summary status, boundary adjustment, and typed skip reason. This is distinct from #287 (preflight timing) and #288 (failure JSON envelope): #289 is the manual recovery command’s own observability/diagnostic gap. + +Required fix shape: (a) extend `CompactionResult` with `skip_reason: Option`, `estimated_session_tokens`, `estimated_compactable_tokens`, `message_count`, `compactable_message_count`, `preserve_recent_messages`, `max_estimated_tokens`, `existing_summary_present`, and `boundary_adjusted`; (b) make text output report the real reason instead of always “below threshold”; (c) make resumed `/compact` JSON include the same diagnostics; (d) align live and resumed manual compact defaults or explicitly report the config difference; (e) regression-test skipped cases for too-few messages, already-compacted session, below-token-threshold, and boundary-preserved tool pairs. Acceptance: a skipped `/compact` tells the user and automation exactly why no messages were removed and whether another recovery path is needed. + +**Status:** Open. No source code changed. Filed 2026-04-26 19:33 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `a6565ae` before filing. Cluster delta: session-continuity-auto-compaction-semantics 2→3 (#287 timing + #288 failure receipt + #289 manual compact skip diagnostics). Concrete delta this cycle: ROADMAP-only pinpoint appended from manual `/compact` code audit.