Skip to content

fix(tui): undo pending prompts and active sessions - #47343

Merged
nexxeln merged 1 commit into
v2from
steering-undo-check
Sep 4, 2026
Merged

nexxeln merged 1 commit into
v2from
steering-undo-check

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix /undo in the V2 TUI while a session is running:

  • Cancel an undelivered prompt through the existing inbox action, without interrupting the active response.
  • For a delivered message, interrupt the session and await session.wait() before staging the revert. Interrupt acknowledgment alone does not mean execution cleanup has settled.
  • Restore the prompt to the captured composer only after cancellation or revert succeeds.

Limited to the existing TUI undo handler; no Core/API changes or added tests.

Validation

Validated with OpenCode Drive 2.1.0 against the real TUI and isolated backend, using controlled simulated model responses:

  • Pending steer: removed from the inbox, original generation remains active, prompt restored and focused.
  • Delivered steer: active generation stopped, correct steering message reverted, prompt restored and focused.
  • Active generation without steering: original prompt successfully reverted.
  • Idle session: undo and redo both succeed.
  • No Session is busy or missing-message error in the successful runs.

Checks: bun typecheck in packages/tui, Prettier check on the changed file, and git diff --check all pass.

Validated head: a0154bcf7c30fcf2326e2dff226ec86c5e56492a (base: 0e143437c88385fa69e233c3084fe1ca55415f70).

Requested by: @nexxeln (nexxel via Slack)

@nexxeln
nexxeln merged commit b78c2ea into v2 Sep 4, 2026
10 checks passed
@nexxeln
nexxeln deleted the steering-undo-check branch September 4, 2026 17:22
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant