test(claude-sdk-oauth): pin the provider-excursion contract shipped in #1749 - #1753
Merged
Merged
Conversation
…injected id keepBindingThenClose re-remembers the binding from the live session entry, so it carries the entry sdkSessionId rather than the value the test injected. The security property is that durable state survives the excursion; the reattach prefix is pinned by the #1747 regression suite.
code-yeongyu
deleted the
fix/1751-binding-lifecycle-security-contract
branch
September 16, 2026 05:21
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.
Fixes #1752
Summary
mainwent red when #1749 merged: this suite still asserted the contract #1749 deliberately replaced.claude-sdk-oauth-binding-lifecycle-security.test.tsasserted that selecting a non-Claude provider forgets the binding, appends{ invalidated: true, reason: "model_selected" }and deletes the sidecar. #1749 made a provider excursion non-destructive (session-registry-wiring.tsnow callskeepBindingThenClose), so all three assertions inverted. The case now pins the shipped contract and carries a comment naming #1747 so the next reader knows why it changed.Why this is not a loosening
The suite's security property is that durable state does not linger after a GENUINE invalidation, and that half stays pinned by the unchanged assistant-rewritten and extensions-removed cases in the same file. A binding kept across an excursion is still refused on the way back by
identityDrift(model_changed) and bywithoutUnconfirmedResumefor an unconfirmed SDK session id — sidecar deletion was never what protected that.Root cause of the miss, recorded so it is not repeated
#1749's regression survey enumerated files that looked topically related (
claude-sdk-oauth-model-switch.test.ts,claude-sdk-oauth-session-registry-wiring.test.ts) and concluded nothing encoded the destructive behavior. The right enumeration is by CONTRACT: grep the assertions for the behavior being changed — herebindingSidecarPathplusinvalidated: true— which finds this file immediately. Its GREEN run also did not include it.Verification
CI on this PR is the gate:
Test (coding-agent 1/3)currently fails onmainattest/claude-sdk-oauth-binding-lifecycle-security.test.ts:200withAssertionError: expected { …(11) } to be undefined, and must pass here.Summary by cubic
Pins the
claude-sdk-oauthbinding-lifecycle test to the provider-excursion contract shipped in #1749, fixing the red build onmain(#1752).The test previously expected that selecting a non-Claude provider forgets the binding, appends
{ invalidated: true, reason: "model_selected" }, and deletes the sidecar. #1749 made a provider excursion non-destructive, so those assertions now invert: the binding and sidecar persist. The binding is asserted by presence rather than its injected id, sincekeepBindingThenClosere-remembers it from the live session entry with that entry's ownsdkSessionId. The security property is unchanged — genuine invalidation still deletes durable state, and a drifted binding is refused on return viaidentityDrift/withoutUnconfirmedResume.Written for commit 487d3af. Summary will update on new commits.