Skip to content

fix(proxy): reconcile durable full resend owner - #1599

Open
Soju06 wants to merge 2 commits into
mainfrom
fix/reconcile-durable-full-resend-owner-takeover
Open

fix(proxy): reconcile durable full resend owner#1599
Soju06 wants to merge 2 commits into
mainfrom
fix/reconcile-durable-full-resend-owner-takeover

Conversation

@Soju06

@Soju06 Soju06 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

The fresh durable full-resend path can still fail before upstream dispatch when a broad legacy session-header sticky row points at a different account than the durable bridge owner: codex-lb returns continuity_owner_conflict as a retryable 503, the client repeats the identical request, and neither persisted owner ever changes — a deterministic retry loop even though the request already carries fingerprint-verified complete context.

This change represents complete durable full-resend eligibility as a sealed, immutable, request-local proof (_VerifiedDurableFullResend) created only by the count/fingerprint/retained-output or response-bound pending-tool-call verifier. For that proved fresh reattach only, the broad session-header alias is dropped from account selection and the upstream handshake, while the durable canonical key and durable owner account remain required. The broad sticky row is left intact for sibling traffic; specific turn-state/previous-response/file owner conflicts remain fail-closed. See openspec/changes/reconcile-durable-full-resend-owner/ for the full design.

Supersedes #1484 — original implementation by @mhooooo, taken over per the 07-30 maintainer notice. The author's commit is preserved with original authorship; takeover fixes sit on top.

What survived vs. what changed in the takeover

Survived unchanged (author's commit, rebased onto current main):

  • The sealed _VerifiedDurableFullResend proof, including the round-4 restack requirement (responses_input_suffix_matches_pending_tool_calls settlement path) — the author had already addressed it before going silent.
  • The owner-bound broad-session reconciliation (fresh_reattach_broad_session_owner_ignored), affinity-header stripping on session creation, the anchor-injection fallback for proof-failed full resends, the openspec change, and the author's unit + integration tests (including the real, unstubbed test_backend_responses_verified_full_resend_ignores_stale_broad_owner_on_durable_account).

Dropped:

Takeover fixes on top (reconciliation with #1486/#1394/#1558/#1527/#1531/#1532 and the codex P1):

  • Restacked onto main's classify_durable_full_resend structure and the post-fix(http-bridge): stabilize silent and clean-close recovery #1394 recovery-attempt journal flow; the unit test's account-neutral classifier assertion is now conditional because main computes neutrality eagerly for the recovery journal on the preserved path. None of the reconciliation was subsumed by fix(http-bridge): stabilize silent and clean-close recovery #1394 — main still leaves the broad session alias in selection for a proved full resend, so the conflict loop remained live.
  • Updated the stale anchor-injection comment (injection can now also run for a full resend that failed proof verification).
  • Addressed the open codex P1 on fix(proxy): reconcile durable full resend owner #1484 (the unit regression test pre-binds the session and stubs _get_or_create_http_bridge_session/_submit_http_bridge_request): added bridge-level coverage test_backend_responses_verified_full_resend_fails_over_to_new_account_after_owner_loss — a real turn completes on account A through the actual create/response-create gate, A is paused, and the verified session-header full resend fails over to account B with the complete history and no previous_response_id.
  • Reworded the modified openspec requirement so the MUST clause sits on the first body line, per the current validator.

Gates

  • architecture-check: pass (no ratchet changes)
  • test-unit: 5283 passed, 3 skipped
  • test-integration-bridge (test_http_responses_bridge.py + test_proxy_websocket_responses.py): 220 passed
  • ruff check / ruff format --check: clean
  • openspec validate reconcile-durable-full-resend-owner: valid

🤖 Generated with Claude Code

mhooooo and others added 2 commits August 4, 2026 10:27
…nt main

Maintainer takeover follow-up on top of @mhooooo's original commit:

- Reconcile with the post-#1394 streaming flow: keep the recovery-attempt
  journal state alongside the sealed full-resend proof, and keep the unit
  test's account-neutral classifier assertion conditional (main now computes
  neutrality eagerly for the recovery journal on the preserved path).
- Update the stale anchor-injection comment: with the sealed proof, durable
  anchor injection can now also run for a full resend that failed proof
  verification, not only for non-full-resend payloads.
- Add bridge-level failover coverage (codex P1 on #1484): complete a turn on
  account A through the real create/response-create gate, pause A, and assert
  the verified session-header full resend fails over to account B with the
  complete history and no previous_response_id.
- Satisfy the current openspec validator by moving the MUST clause onto the
  first body line of the modified requirement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants