fix(opencode): carry the in-flight request through auto-compaction
Description
Fixes the remaining half of USE-2680. andytown #27141 hid the compaction summary from the chat, and the synthetic continue prompt was already hidden. What users still see is the model's own behavior after compaction: it stops, narrates the state, and asks a question instead of resuming.
Two things in the fork combine to cause that:
- The retained tail is a contiguous slice chosen by token budget, and
splitTurnmay start it at an assistant message inside the current turn. The user's actual instruction is then summarized into a one-line## Objective. In the Swanson session (bbe6fd08…),tail_start_idlanded on the 17:52:37 assistant step, so the 17:52:20 "rebrand this for my site and branding…" request left the model's context. In Noah's session the tail was empty. - The continue prompt said "Continue if you have next steps, or stop and ask for clarification if you are unsure how to proceed." A model holding only a paraphrase is always a little unsure. GPT-5.6 replied "Here's where things stand: …" and asked "When you said 'rebrand this for my site and branding' … what did you mean?"
This PR changes the continue prompt only. It quotes the in-flight request verbatim (the last user message with a non-synthetic, non-ignored text part, capped at 8,000 chars) and replaces the nudge with: continue from Next Move, say so briefly if nothing remains, do not restate the summary, and only stop to ask if you cannot proceed without the user's input. The summary template, tail selection, and overflow replay are untouched.
Not shipped to the fleet until a release tag and an OPENCODE_VERSION bump in andytown.
Testing
bun test test/session/compaction.test.ts: 54 pass. The existing auto-continue test now asserts the quoted request and the new directive. A new test runs two compactions on one turn and asserts the second nudge quotes the original request rather than the prior synthetic nudge.bun run typecheckinpackages/opencode: clean.
🤖 Generated with Claude Code
Summary by cubic
Fixes USE-2680 by carrying the user's in-flight request through auto-compaction: the continue prompt now quotes the request verbatim and directs the model to resume, so it stops narrating its state and asking what the request meant.
Bug Fixes
- The continue prompt includes the last non-synthetic user text, capped at 8,000 chars, and tells the model not to restate the summary.
- Adds a test covering a second compaction, which quotes the original request rather than the prior continue prompt.
- Not shipped to the fleet until a release tag and an
OPENCODE_VERSIONbump.