You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undo should expose a completed compaction boundary in TUI and Desktop/Web #41266
A completed compaction must be undoable as its own history boundary. With this sequence:
user prompt → assistant work → completed compaction → later agent work
Current rollback can fall back to the preceding user message rather than the compaction. That rewinds past assistant output that existed before the compaction, so there is no way to restore the exact pre-compaction state.
This is related to #8689, but is the compaction-specific consequence: compaction is now a durable request, yet it is not consistently exposed as an undo target. It also regresses the practical resolution of #32368, where /undo could remove the compaction marker while keeping the preceding assistant turn.
Steps to reproduce
Use a session and send a prompt; wait for the assistant to finish work.
Run /compact and wait for compaction to complete.
Let the agent produce more work after compaction.
Invoke Undo or use the client's revert UI.
Expected behavior
Undoing a completed compaction should remove the compaction and subsequent work, while retaining all messages before the compaction, including the preceding assistant turn, and restore that history to active context.
This must be discoverable in every client:
Desktop/Web: a clickable Undo compaction action on or next to the completed compaction marker.
TUI: a named command-palette/slash-command or keybinding action; where mouse actions are available, the same action should be clickable at the compaction marker.
All entry points must target the compaction boundary itself, not silently fall back to the preceding user message.
Actual behavior
The nearest undo target can be the preceding user message. Undoing from there discards the assistant messages between that user message and the compaction point, so the pre-compaction state cannot be restored exactly.
changed the title [-]V2 undo cannot revert a completed compaction without discarding pre-compaction assistant turns[/-][+]Undo should expose a completed compaction boundary in TUI and Desktop/Web[/+]on Aug 8, 2026
adding that interrupting a compaction and sending a user message should not rerun compaction before the new user message: if the user wants to redo compaction, then the / command is there, otherwise the chat should resume from the previous agent message.
This is related to this issue because /undo undoes the previous agent message instead of the compaction block
Activity
[-]V2 undo cannot revert a completed compaction without discarding pre-compaction assistant turns[/-][+]Undo should expose a completed compaction boundary in TUI and Desktop/Web[/+]andreasntr commentedon Sep 26, 2026
adding that interrupting a compaction and sending a user message should not rerun compaction before the new user message: if the user wants to redo compaction, then the
/command is there, otherwise the chat should resume from the previous agent message.This is related to this issue because
/undoundoes the previous agent message instead of the compaction blockthdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊