Skip to content

fix: preserve revert consistency - #46974

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

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 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 preserve optimistic input across revert events, order agent/model changes with admission, retry once with the same message ID, and choose undo boundaries by transcript position. Image loading stays inside the existing session's admission reservation. Plugin setup and prompt hooks get invocation-scoped synthetic admission to avoid deadlocking the waiting prompt.

session.prompt gains optional context, for steer delivery only. Required code generation also refreshes stale upstream API snapshots.

How did you verify your code works?

Bun 1.4.2, based on origin/v2 at 5556ad563d:

  • Root bun run check, generated-file checks, the website build, and Effect lint checks passed.
  • Core: 5,618 pass, 41 skip, 14 failures. The 13 shell failures reproduce on clean 5556ad563d; the additional VCS timeout passes in isolation on both trees. Client: 178 pass and four contract/import-boundary failures also reproduced on the clean base.
  • TUI: 1,457 pass, two skip. Server: 61 pass, three skip. App: 950 unit and 157 browser tests pass, one skip; initial browser-suite timeouts passed in isolation and the serial suite rerun.
  • All 13 production-browser revert/queue tests passed. Final tab-switch benchmarks collected 15 samples per ref: no wrong-session frames or extra requests; timings were mixed.

Coverage includes staged resume/wake, atomic replacement failure, concurrent undo/admission, image submission ordering, same-ID retries with browser comments, plugin-hook reentrancy, pending-input preservation, and paginated boundaries.

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 2 times, most recently from 72d9544 to f9b46da Compare September 10, 2026 17:11
@CasualDeveloper
CasualDeveloper force-pushed the fix/37751-revert-consistency branch from f9b46da to 6dfd653 Compare September 15, 2026 14:12
@CasualDeveloper
CasualDeveloper force-pushed the fix/37751-revert-consistency branch 2 times, most recently from 2f8698b to 0e247a4 Compare September 28, 2026 04:11
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
@CasualDeveloper
CasualDeveloper force-pushed the fix/37751-revert-consistency branch from 0e247a4 to 90b23ac Compare October 1, 2026 02:10

This branch has not been deployed

No deployments
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