Repository navigation
Closed as not planned
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Description
Outcome
TUI /undo, the undo shortcut, message Revert, and /redo correctly stage, advance, and clear rollback state for canonical Session V2 turns containing structured $skill mentions. Restored composer input preserves the structured mention when the exact Skill is still available and reports the existing actionable error when it is not.
Governing RFC
RFC-0012, especially “$skill structured mention” and its requirement that undo/history restore rebuild or remove the bound extmark. This is a bug fix restoring accepted behavior, not a new product decision.
In scope
- Route undo/redo to Session V2 revert APIs when the rollback boundary is a canonical message.
- Read canonical revert state consistently for command availability and execution.
- Restore structured skill/file/agent prompt state through the canonical restoration path.
- Preserve legacy undo/redo behavior for legacy-only turns.
- Add regression coverage for canonical skill undo/redo routing and prompt restoration.
Out of scope
- Changing Session V2 revert semantics or durable schemas.
- Changing Skill catalog admission or snapshot format.
- Migrating all ordinary TUI prompts from the legacy Session API.
- Changing Web/Desktop behavior.
Dependencies
None.
Contracts and likely areas
packages/tui/src/routes/session/index.tsxpackages/tui/src/routes/session/dialog-message.tsxpackages/tui/src/util/session-message.ts- TUI command/session tests
- Existing Session V2
revert.stage,revert.clear, andrevert.commitcontracts remain unchanged.
Acceptance checks
- Undoing the newest canonical
$skilluser turn stages its canonical message ID and restores the structured Skill mention in the composer. - Repeated undo advances to the preceding user boundary without crossing storage models incorrectly.
- Redo uses canonical staged state and either advances the boundary or clears it at the end.
- A canonical Skill no longer available in the active catalog produces the existing actionable error and does not stage a revert.
- Legacy-only turns retain existing undo/redo behavior.
- Failures are surfaced instead of becoming successful no-ops.
Verification
- Package-local TUI unit tests and typecheck.
- Relevant Core Session V2 revert tests.
- Mac real-device TUI: create a temporary Session, submit a
$skillturn, exercise message Revert,/undo, repeated undo, and/redo; capture screenshot/log evidence. mywindows/WSL2 real-device TUI throughopencode-rexd: repeat the same temporary Session scenario against the same commit; capture screenshot/log evidence.
Risks and compatibility
- Incorrect V1/V2 routing could delete or hide the wrong transcript boundary; tests must cover mixed legacy/canonical timelines and repeated undo/redo.
- Composer reconstruction must never expose embedded Skill instruction bodies.
- No generated API/SDK artifacts are expected.
Metadata
Metadata
Assignees
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Activity
hammershock commentedon Sep 11, 2026
Claimed for implementation on branch
skill-undo, based oneead763fdf5fb91f383561b9df85330b3b43f6e9. Worktree:~/workspace/opencode-worktrees/skill-undo.github-actions commentedon Sep 11, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:.fix(tui): ...) rather than a descriptive issue title.Please edit this issue to use one of the standard templates and address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
hammershock commentedon Sep 11, 2026
Opened in the wrong repository by mistake; closing immediately.