Skip to content

fix: preserve revert consistency - #46974

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

fix: preserve revert consistency#46974
CasualDeveloper wants to merge 1 commit into
anomalyco:v2from
CasualDeveloper:fix/37751-revert-consistency

Conversation

@CasualDeveloper

@CasualDeveloper CasualDeveloper commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

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

Type of change

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

What does this PR do?

I serialize revert changes and prompt admission per session, and keep model execution parked while a revert is staged. A replacement prompt and its optional synthetic context commit atomically with the revert. Pending input before the chronological boundary is retained.

The clients show input immediately, order agent/model changes with admission, retry admission once under the same message ID, and choose undo boundaries by transcript position. Plugin setup and prompt hooks can admit synthetic input through invocation-scoped capabilities without deadlocking the reservation.

session.prompt gains optional context, for steer delivery only. The clients, OpenAPI, and website API documents are regenerated.

How did you verify your code works?

Using Bun 1.4.2 on local v2 at 573d76933f:

  • Affected package typechecks and the full-workspace pre-push typecheck passed.
  • Core: 5,440 pass, 41 skip, 13 shell failures. All 13 reproduce on clean v2 in the same three test files.
  • TUI: 1,374 pass, 4 skip. Client: 166 pass. Server: 57 pass, 3 skip.
  • App: 844 unit and 157 browser tests pass, 1 skip. All 3 production-browser revert tests pass.
  • Production tab-switch benchmark: 15 samples per version, comparable timings, unchanged request counts, no wrong-session frames.
  • Generated-file checks, website build, lint, and 10 Effect lint-rule tests passed.

Regression coverage includes staged resume/wake, concurrent undo and admission, atomic replacement failure, same-ID retries, plugin-hook reentrancy, pending-input preservation, and paginated undo boundaries. The three new execution tests fail without the drain guard.

Screenshots / recordings

Logic change; existing UI exercised in production-browser tests.

Checklist

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

Process: human-directed and reviewed, with agentic assistance from Anthropic/Claude and OpenAI/ChatGPT.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

The search found PR #42461 "fix: make revert boundaries chronological" which is the related PR mentioned in the current PR's description as being superseded. This is expected since PR #46974 explicitly states it "Supersedes #42461" and folds in that fix.

No other duplicate or competing PRs were found that are addressing the same revert consistency and session prompt ordering issue.

No duplicate PRs found

@CasualDeveloper
CasualDeveloper force-pushed the fix/37751-revert-consistency branch 2 times, most recently from 7c3cb99 to c0ce754 Compare September 5, 2026 17:32
@CasualDeveloper
CasualDeveloper force-pushed the fix/37751-revert-consistency branch from c0ce754 to 72d9544 Compare September 10, 2026 17:06
Keep execution parked while a revert is staged and serialize revert
mutations with prompt and synthetic admission. Commit replacement
prompts and their optional context atomically with the revert, retaining
queued input before its chronological boundary.

Keep projected reads in SessionStore and scope plugin setup and hook
admission bypasses to their active invocation. Serialize client
mutations while preserving optimistic display and same-ID retries;
resolve undo boundaries by transcript position rather than message ID.

Closes anomalyco#37751, anomalyco#44357
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