Description
Description
/compact can leave completed work under ## Next Steps.
Cause:
compaction.tail_turns defaults to 2
- recent turns are preserved via
tail_start_id
- those turns are excluded from the summarizer input
- stale
Next Steps from the previous summary can survive even when the preserved tail says the work is done
Relevant code:
packages/opencode/src/session/compaction.ts
DEFAULT_TAIL_TURNS = 2
select() returns head: input.messages.slice(0, keep.start) plus tail_start_id
buildPrompt() updates the previous summary without a recent-tail reconciliation pass
Expected:
- completed items are not listed under
## Next Steps
- completed items move to
Done, Critical Context, or are removed
Actual:
- completed items can remain under
## Next Steps
- the agent can repeat already-finished work after compaction
Suggested fix:
- pass a small text-only recent-tail audit into the compaction prompt
- use it only to reconcile
Done, In Progress, Blocked, and Next Steps
- keep the preserved tail behavior unchanged
- tighten
Next Steps to unfinished future actions only
Regression test:
- previous summary has
Next Steps: run tests
- preserved recent tail says tests were run and passed
- new summary must not list
run tests under Next Steps
Plugins
none
OpenCode version
Latest dev from source inspection. Exact release not tested.
Steps to reproduce
- Create a session with an existing compaction summary.
- Let that summary contain
## Next Steps, e.g. run tests.
- Complete that item in the next one or two turns.
- Run
/compact.
- Inspect the new summary.
Expected: completed item is removed from ## Next Steps.
Actual: completed item can remain under ## Next Steps.
Screenshot and/or share link
N/A
Operating System
macOS
Terminal
iTerm2
Description
Description
/compactcan leave completed work under## Next Steps.Cause:
compaction.tail_turnsdefaults to2tail_start_idNext Stepsfrom the previous summary can survive even when the preserved tail says the work is doneRelevant code:
packages/opencode/src/session/compaction.tsDEFAULT_TAIL_TURNS = 2select()returnshead: input.messages.slice(0, keep.start)plustail_start_idbuildPrompt()updates the previous summary without a recent-tail reconciliation passExpected:
## Next StepsDone,Critical Context, or are removedActual:
## Next StepsSuggested fix:
Done,In Progress,Blocked, andNext StepsNext Stepsto unfinished future actions onlyRegression test:
Next Steps: run testsrun testsunderNext StepsPlugins
none
OpenCode version
Latest
devfrom source inspection. Exact release not tested.Steps to reproduce
## Next Steps, e.g.run tests./compact.Expected: completed item is removed from
## Next Steps.Actual: completed item can remain under
## Next Steps.Screenshot and/or share link
N/A
Operating System
macOS
Terminal
iTerm2