Repository navigation
fix(bin): put a read cue first in context re-emit output - #7298
kunchenguid merged 1 commit into
Conversation
Claude spills a hook output over 10,000 characters and shows only the first 2,000 plus a saved-file path. The re-emit prints captain.md and learnings.md last, so they never reached the session. Print a short cue first that names the saved file and the memory files, and document the cap. Refs kunchenguid#6303
|
Speaking as Kun's firstmate: thank you @Azd325 — this is a really sharp catch. A compacted Claude session that only sees a 2,000-character preview of its re-emit has lost exactly the digest the re-emit exists to restore, and a cue at the head is a small, sensible fix. What I reviewed (head Contract-class: restore. VISION: One captain / Authority / Scripts / Restart / Spine / Vendor / Scope all align. It strengthens "a restart is a non-event", and the cue is plain text in the existing script. One gap. This is waiting on you: live validation is inconclusive (1 of 3 scenarios). The cue at the head is shown live. Two scenarios weren't run because the sandbox hit the runtime bound: the cue landing inside the first 2,000 characters of a >10,000-character re-emit, and a normal start leaving the cue out. If you get a chance, could you run those two on a faster host (for example with CI update: the new `test_reemit_cue_survives_the_hook_output_preview` passed in CI (serial 4). The two red jobs look unrelated to your change: serial 2 hit the 30-minute timeout in `fm-supervision-host.test.sh`, and serial 4 failed in `fm-remote-reply.test.sh` (NUL-bearing line capture). I re-ran the failed jobs. |
|
Thanks for the review. Here is the evidence for the two open scenarios and the lint warning. Host: macOS arm64, head 151c0b6, a temporary home with a padded captain.md.
Each run took about 5 s.
|
|
Speaking as Kun's firstmate: this is merged. Thank you @Azd325 — really appreciate you taking the time on this. Your follow-up closed the gap from my last comment. The cue sits on line 1 of the first 2,000 characters of a 32,737-byte re-emit, and a normal start prints no cue. The lint warning came from |
What Changed
bin/fm-session-start.shnow prints a shortRE-EMIT CUEat the head of a context re-emit. A harness that spills large hook output and shows only its head still tells the model to read the saved full output or the missing durable records. The "go to a source directly" list gains a matching entry.docs/sessionstart-nudge.mddocuments Claude's 10,000-character hook output cap, the 2,000-character preview, and why the cue comes first.tests/fm-session-start.test.shadds coverage for the cue on a re-emit.Fixes #6303
Risk Assessment
✅ Low: The change adds three printf lines that run first, and only in --reemit mode, plus a list bullet, a doc note and a regression test. The fleet-state-first order is unchanged, the normal-start output is unchanged, and the user intent (a head-bounded cue that survives the spill) is met.
Testing
A live --reemit run on a lab home printed the RE-EMIT CUE as the first lines, but the run timed out at 100s so the full output past the 10,000-character cap was never produced. The full test file hit the script's 120s runtime bound, and the isolated new test was killed at 110s with no result. The head-bounded cue is confirmed live; the 2000-character-preview and normal-start-omits-cue assertions are not.
Evidence: re-emit head from live run
Source: re-emit head from live run
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bin/fm-session-start.sh --reemit against a disposable lab home (live, killed at 100s)bash tests/fm-session-start.test.sh (hit the script's 120s runtime bound)isolated run of test_reemit_cue_survives_the_hook_output_preview (killed at 110s)✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.