Skip to content

fix: preserve revert consistency - #55315

Closed
CasualDeveloper wants to merge 1 commit into
anomalyco:devfrom
CasualDeveloper:fix/37751-revert-consistency
Closed

CasualDeveloper wants to merge 1 commit into
anomalyco:devfrom
CasualDeveloper:fix/37751-revert-consistency

Conversation

@CasualDeveloper

@CasualDeveloper CasualDeveloper commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #37751, #44357
Supersedes #46974, #37752, #42461

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This replaces #46974 after cleanup and V2's promotion to dev. Both PRs are now closed; the automated scope review requests smaller follow-ups.

A staged revert now parks execution. Its replacement prompt, changed selection, and optional context commit together; earlier pending input survives. Client Undo uses the session/history captured at the gesture, while ordered admission keeps optimistic input immediate and preserves queue rollback and full-clear redo.

Selection applies only to winning new admissions with requested and prepared steer delivery. Plugin admission bypasses expire with their invocation, and Stop stays interruptible before pending snapshot publication.

How did you verify your code works?

Verified eb76193b51 on frozen dev at e9def88a77:

  • bun run check: 36 typechecks pass; zero lint errors, 1,457 warnings. Generated checks and website build/link validation pass.
  • Core/Server/Schema/Plugin regressions and full App/TUI lanes pass. All 41 revert/queue browser cases pass without retries.
  • Exact-base failures remain: four Client cases, SDK web search, four E2E diagnostics, and tab rename in the broader 50/51 browser run.
  • Server passes with the repo's temporary HOME/XDG harness; its unisolated admission case times out. Earlier App loopback/cold-import failures pass in the final unchanged lanes.
  • Benchmark scenarios pass, but timings vary (combined medians up to 68 ms slower). No speedup or performance-equivalence claim.

Screenshots / recordings

No visual redesign; the production UI is exercised with isolated fixtures.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Process: human-directed, with agentic assistance from Anthropic/Claude and OpenAI/gpt-6.1-sol.

Park execution while a revert is staged and serialize revert mutations
with prompt and synthetic admission. Commit replacement prompts, changed
selection, and optional context atomically with the revert, retaining
pending input before its chronological boundary.

Apply selection intent only to winning steer admissions. Keep queued
requests and same-ID retries from reapplying selection, share the short
admission lock with explicit switches, and expose intent to prompt hooks
without claiming it is already committed.

Keep projected reads in SessionStore and scope plugin setup and hook
admission bypasses to their active invocation. Serialize client mutations
without delaying optimistic display or releasing same-ID retries early.
Do not hold the input FIFO through shell completion or certify agent
selection from reconciled admission receipts.

Keep pending start-snapshot readiness interruptible when a provider fails
before first assistant publication, so Stop can release execution and
subsequent revert staging. Retain uninterruptible final step/tool cleanup.

Bind delayed undo to its captured Session and paginated chronological
history, and preserve queue rollback and full-clear redo. Regenerate the
public clients and API documents from the prompt schema.

Closes anomalyco#37751, anomalyco#44357
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot closed this Oct 14, 2026
@opencode-agent

Copy link
Copy Markdown
Contributor

Thanks for keeping this up to date after #46974 was closed. The bug in #37751 is real, but at about 2,300 non-test lines across core, server, protocol, plugin, client, app and TUI, this is too large to review as one pull request. It also mixes a public API change with several separate fixes.

Could you split it into smaller, focused pull requests that can each be reviewed on its own? For example:

  • Core: stop execution while a revert is staged, and commit the revert together with the next admission (V2 session revert can race with session execution #37751), with the core tests.
  • Prompt API: the optional context and selection fields on session.prompt, with the protocol/schema changes and regenerated OpenAPI and client files.
  • Plugin and runner: invocation-scoped synthetic admission for plugin setup and hooks, and keeping execution interruptible when the provider fails before any output.
  • App: Undo captures its target when you trigger it, plus queue rollback and full-clear redo.
  • TUI: Undo capture, draft stash and retry changes. Please check how this fits with fix(tui): undo prompts the server already accepted #54163, which also touches TUI undo.

You're welcome to open those. Smaller pull requests are much easier to review.

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.

V2 session revert can race with session execution

1 participant