Repository navigation
Fix L-01: late 401/410 cannot replace a newer session - #3
Merged
Merged
Conversation
…cannot replace a newer session Codex live qualification L-01: an obsolete request's 410 arriving after a scenario switch started another session, and the new scenario's lookups then read a session that did not own its proposal. Each reset now bumps a generation; a 401/410 from a superseded generation retries under the current session instead of resetting again (concurrent recoveries coalesce). Adds the exact browser sequence as a regression test. Engine, API and policies unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideThe PR fixes the L-01 race by associating API requests with session generations: a late 401/410 from an obsolete session now retries under the already-current session instead of triggering another reset, allowing concurrent recovery paths to coalesce. A Playwright regression reproduces the exact delayed-410 scenario-switch sequence, and the README reflects the added test. Sequence diagram for session generation recoverysequenceDiagram
actor User
participant UI
participant API
participant Server
User->>UI: Replay current decision
UI->>API: api(POST, replay)
API->>Server: fetch(replay)
User->>UI: Click Routine payment
UI->>API: newSession()
API->>Server: fetch(/api/session)
Server-->>API: New session
Server-->>API: 410 response
API->>API: api(POST, replay, retried)
API->>Server: fetch(replay) under current session
Server-->>API: Successful response
API-->>UI: Routine payment proposal
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2. During live qualification, Codex found L-01: an obsolete request's 410 that arrives after a scenario switch starts another session, and the new scenario then shows
proposal not found in this session.Fix
ui/src/api.ts: each session reset increments a generation counter. A 401/410 from a superseded generation retries under the current session instead of resetting again, so concurrent recoveries coalesce into one reset. The engine, API and policies are unchanged.Test
New Playwright regression that replays Codex's exact sequence: hold a replay 410, switch to Routine payment, deliver the 410 before the proposal reaches the UI. It fails on v1.0.1 with the original error and passes with the fix. Results: 11/11 E2E, 95/95 unit tests, typecheck clean.
Not deployed. Owner approval is required for v1.0.2.
🤖 Generated with Claude Code
Summary by Sourcery
Ensure obsolete session responses cannot disrupt a newer scenario session during concurrent recovery.
Bug Fixes:
Documentation:
Tests: