fix(claude-sdk-oauth): never resume an SDK session id that init never confirmed - #1318
Merged
Merged
Conversation
code-yeongyu
force-pushed
the
fix/claude-sdk-oauth-unconfirmed-binding
branch
from
September 3, 2026 04:38
27e5f55 to
d4ed57d
Compare
…nfirms the session id Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
…and drop ids Claude Code reports missing The first cut forgot every binding an unconfirmed entry published, which also erased the same-turn retry checkpoints #723 relies on. Carry the confirmation on the binding instead: init or the replay echo confirms the id, an unconfirmed binding may still drive a byte-identical same-turn re-seed but never a resume or fork (new continuity reason session_unconfirmed), and a failure that names 'No conversation found with session ID' forgets the binding outright.
…rd and report session_unconfirmed The retained-attempt wrapper calls discard() after a failed attempt, which re-published the checkpoint of an id Claude Code had just declared missing; discard now forgets it instead. session_unconfirmed joins the sanitized continuity reasons so observations and telemetry keep the attribution instead of downgrading it to other.
code-yeongyu
force-pushed
the
fix/claude-sdk-oauth-unconfirmed-binding
branch
from
September 3, 2026 05:02
51365a7 to
b0adf44
Compare
…r the unconfirmed-binding fix
This was referenced Sep 3, 2026
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.
Summary
After a failed cold seed,
claude-sdk-oauthkept a continuity binding whose SDK session id had only ever been minted locally. The next turn chosereattach, Claude Code answeredNo conversation found with session ID: <id>, and every later turn repeated the cycle with zero usage (oh-my-openagent#7562). A session id is now resumable only once Claude Code acknowledged it, and an id Claude Code reports missing is dropped instead of retried.Changes
session-registry.ts,session-registry-pump.ts): resident entries carrysdkSessionIdConfirmed; entries created from a resume start confirmed, locally minted ids start unconfirmed, and both asystem/initmessage and the replay echo that claims the turn confirm the id.session-reattach.ts,session-continuity.ts,session-observability.ts): bindings carry the flag;withoutUnconfirmedResumeturns areattach/forkon an unconfirmed binding intoflattenwith the new reasonsession_unconfirmed. Same-turn retry checkpoints (timeout_retry, Retry after provider stream-start timeout re-bills the full conversation (cache_control dropped / breakpoints moved) — measured 5.7x cost #723) are untouched because they never resume the id.session-turn-attempt.ts): an attempt whose failure namesNo conversation found with session IDforgets the binding outright.AGENTS.mdinvariant list,changes.mdentry, CHANGELOG bullet.QA & Evidence
Evidence dir:
sisyphuslabs/.omo/evidence/ulw/claude-sdk-fable51-20260903/(all runs on bunshinmengmotaMac, never local).g7-red.log): the #7562 repro (is_error result before init/replay) left a resumable binding with the unconfirmed id.laneE-orch-green2.log):claude-sdk-oauth-unconfirmed-binding.test.ts6/6 plus observability, Retry after provider stream-start timeout re-bills the full conversation (cache_control dropped / breakpoints moved) — measured 5.7x cost #723 retry continuity, continuity-decision, pump, session-registry and reattach suites: 7 files / 74 tests.g7-mutation-orchestrator.log, run by the orchestrator): removing the unconfirmed guard, the dead-id forget, or the claim confirmation each fails exactly one test.g7-regression-orchestrator.log):tsc --noEmit -p tsconfig.build.json+ biome + fullclaude-sdk-oauthcluster: 485 passed / 3 skipped at 27e5f55 (before rebase).Risks & Residuals
init/replay for oversized flattened prompts. If it does, those turns now cold-seed again instead of resuming a dead id, which is the safe direction.Related Issues