Repository navigation
fix(gateway): retain device source identity across reconnects - #176972
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
Codex review: blocked before merge. What this changesPreserve model-source comparison identity across matching authenticated Control UI reconnects while keeping each request independently revocable. Example: The paired device reconnect-device reconnects while its original native child is still running.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current reconnect identity mismatch with no discrete correctness findings; security-owner acceptance of cross-socket comparison sharing remains unresolved. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherAuthenticated Gateway dispatch captures device and policy facts; the revocation and operator-authority owners issue comparison identities consumed by native child-input admission, alongside separate live authority checks. flowchart LR
A[Authenticated Control UI reconnect] --> B[Gateway request dispatch]
B --> C[Device revocation owner]
C --> D[Retained comparison identity]
B --> E[Independent request authority]
D --> F[Native child input admission]
E --> F
F --> G[Original native child]
Technical reviewBest possible solution: Use the existing identity issuers to recognize verified matching reconnects while preserving independent authority, revocation and native model ceilings. Do we have a high-confidence way to reproduce the issue? Current main allocates comparison records per client object, explaining the mismatch against a retained child; the supplied production-native captures support that mechanism, and no target code was executed during this read-only review. Is this the best way to solve the issue? Fixing the authenticated identity issuer is the smallest complete approach: it preserves the native guard and existing revocation owner instead of introducing replacement permissions or a parallel admission path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bead2a8e5427. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +93, Tests +279. Total +372 across 5 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 20, 2026, 5:02 PM ET / 21:02 UTC (Revision 4). |
|
Post-merge relationship to #177698, landed as The selected direction is supported Codex-style human steering with current peer-mail scheduling preserved; the native app-server API does not expose Codex’s mailbox. This PR repairs verified reconnect comparison identity and does not change that scheduling policy. Cross-socket comparison sharing was extracted from the consolidation and remains a separate fix here. A verified matching Control UI device-token reconnect can compare as the same source for retained native work, while each connection and execution keeps an independently revocable live authority. Foreign devices, changed credentials and invalidated authority retain their refusal paths. #180204’s exact-thread closure repair is separate. The PR body records the current functional checks, revision-qualified native evidence, failed-collector limitations and exact-revision security approval requirement. The consolidation merge and comparison identity do not grant new execution authority. |
1abc894 to
42aff70
Compare
|
@clawsweeper re-review The body now includes revision-qualified production-native evidence for the previously unrun matching-reconnect delivery and foreign-device refusal: the original child consumed the actual peer message, while a different paired device with the same profile/scopes was rejected before child input. The determining identity, authentication, comparison and submission owners were verified against the current standalone head The body explicitly distinguishes unchanged-source reuse from standalone execution. The native version override, synthetic provider, differing neighboring owners and failed/contained captures remain qualified. Native-child credential revocation during preparation remains unrun, and security-owner approval remains required; neither is claimed resolved. Please reassess the new evidence and retain any remaining concrete requirements. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The body now adds an exact-head real native child-send control: canonical revocation of the original device credential while genuine metadata preparation is held cancels the retained source before child input; the child completes unchanged. Root independently verified raw hook-start/request/receipt/terminal correlations, zero child guidance/input effects, all 276 frozen pins and both normal native exits. The original collector remains exit 1: cancellation emitted no matching hook/completed receipt, so its strict observer failed and task state was retained. The body does not call this a full collector pass, isolated post-await assertion proof or complete cleanup. It credits only the actual source-cancellation boundary with clean process joins. The runtime build passed; the separate full-QA declaration-size failure remains disclosed. The two hosted CI failures are now attributed using determining blobs from the actual tested merge and incoming base, without inventing an executed-base reproduction or modifying unrelated xAI/UI code. Please assess the supplied boundary evidence and retain the separate security-owner/maintainer decisions. |
|
🦞👀 Re-review progress:
|
|
Updated this focused proposal to The unchanged reconnect regression now also has causal baseline evidence: restoring only its three determining pre-fix owners in the current supported harness produces the intended source-identity failure (1 failed, 2 controls passed); restoring candidate owners makes all 3 pass. Seven sibling suites pass 87 cases. This is determining-source rollback proof, not execution of the entire historical base. Earlier native traces and failed-collector qualifications retain their exact recorded revisions. The corrected body makes these distinctions explicit. No feature-owner behavior changed during this integration. Security-owner acceptance remains required; these tests do not grant it. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/allow-security-sensitive-change |
|
Merged via squash.
|
What Problem This Solves
Refreshing the browser or reconnecting after a network interruption can leave the assistant unable to communicate with child agents it already started. Those agents are still working, but a request to send them more instructions fails with “Native hook relay unavailable.”
The returning connection is being treated as a different source from the connection that started the work. This fix recognizes a verified reconnect from the same authenticated device while continuing to check whether each request is allowed.
User Impact
A browser reconnect no longer breaks the assistant's ability to pass instructions to its existing native child agents. The user can return to ongoing work and continue directing it, rather than encountering an identity error while the child keeps running.
A different device or changed credential is still treated separately, and revoking access still blocks further requests. This changes how a verified returning connection is recognized; it does not give the connection new permissions or change peer-message scheduling.
Why This Change Was Made
Fix the identity issuer. Share a comparison record only when the host-verified device credential generation, profile, role, scopes, client/origin, policy generations and exact access/ingress owners match. The existing revocation owner retains records only while captured work holds them. A host-transferred principal can use that record; a copied client cannot borrow it.
Different devices, rotated tokens, profiles, reduced scopes, unproven authentication and distinct access grants stay separate. Reconnect matching grants no replacement permissions. No configuration, protocol, schema, native-model guard, or credential-storage change is introduced.
Relationship to the consolidation
#177698 merged as
f83b7ade15f3aefad7b367bef084ea5ffdbd9f8b. Verified cross-socket reconnect comparison sharing was deliberately extracted, so this PR remains distinct and is not superseded by that merge.This proposal keeps parent-to-running-native-child messaging usable after a verified matching Control UI device-token reconnect. It shares comparison identity only; each connection and retained execution still has its own live, independently revocable authority. It does not replace #180204's separate exact-thread closure handoff repair.
At current head
de1dfafe07c8f0762b9e5fc16d4dfc6b36a3fbeb, the completed functional checks have no failed jobs. The security-sensitive review and aggregate gate explicitly require a maintainer to approve this exact revision. The remaining decision is acceptance of verified reconnect comparison sharing; no security-owner approval is claimed by these tests or the consolidation merge.Evidence
Current integration head:
de1dfafe07c8f0762b9e5fc16d4dfc6b36a3fbeb, an automatic merge of the preceding standalone42aff70a9169d5043a4faf559f13c63bc248bb4fwith upstreamf629720edbb9f4b458adae30c7506c1dc5d1adc6. The latest completed ClawSweeper review examinedde1dfafeand credited the source-qualified matching-reconnect and foreign-device evidence, with their recorded revision and collector qualifications. The determining feature owners and unchanged reconnect regression retain their bytes; historical runtime captures below retain their stated revisions. Security-owner acceptance remains outstanding.Current CI integration and causal baseline
This automatic upstream merge addresses the named inherited xAI test-type failure, adopting upstream's canonical
0449ef26/ #177830 repair. It introduces no local dependency workaround, budget change or manual conflict resolution. Core production types, owning Gateway test types and the extension-test graph that previously failed on xAI now pass, as do scoped type-aware lint and formatting.The existing reconnect regression was also executed unchanged under the current supported harness with only its three determining production owners restored to exact pre-fix
9509fc22f772876605df5121d99f97923074a21ebytes (which equal incoming upstream): one intended failure and two passing controls. The failure is the original source object-identity assertion for a verified matching reconnect; restoring the candidate owners makes all three cases pass. Seven sibling suites pass 87 cases, covering source lifetime, policy closure, device revocation, operator profile/model restrictions and cross-module identity. This is a three-owner determining-source rollback, not execution of the entire historical base tree. The initial old-harness compiler mismatch failed before tests and is not counted as RED.No fresh runtime/native capture is claimed for this merge. Existing accepted native receipts stay revision-qualified, including the failed collector and cleanup qualifications below. Current hosted CI is separate from these local checks; no security-owner approval is inferred.
The combined alternative’s published runtime receipts, contains actual synthetic native reconnect evidence captured at
b579b5c49caee812795fb486739e93aafcadc541. This is qualified source-owner reuse, not execution of this standalone head:collaboration.send_messagereached the original still-running child. A correlated native completed-interaction receipt, subsequent child provider request, one attributed native peer MESSAGE echo and the consumed final all identify that same original child turn.42aff70a9169d5043a4faf559f13c63bc248bb4fand capturedb579b5c49caee812795fb486739e93aafcadc541revisions have byte-identical credential attestation, authenticated dispatch, device comparison records, operator authority, admitted context, retained host source, native source/child monitor, compatibility check and submission/final-check owners. Comparison sharing still does not share execution authority or replace either source’s original/current model ceilings.Both child cases used fresh temporary state and scripted loopback provider responses with the actual native
0.163.0binary; the source dependency pin remained0.162.1. The private synthetic model-metadata V2 adaptation is disclosed. All owned native processes joined with exit0/signal:null; ordinary teardown forwarded two SIGTERMs after selected native turn terminals in each case. Gateway cleanup reported confirmed stopped with no errors. These captures prove neither external-model performance nor historical incident token continuity.Remaining boundaries
The combined revision also captured canonical device revocation during genuine human steering preparation: the original admitted request was denied after preparation resumed, with no observed native steering input. That case used a materially different combined continuation owner, and its native process required SIGKILL containment; the original failed clean-exit qualification is retained. It is not a clean passing native-child preparation-revocation case for this standalone branch.
The new native child-send control below exercises canonical credential revocation during genuine preparation. Its observed cancellation/no-input result and its failed collector qualification are reported separately. The native-hook waiting implementation, host active-closure implementation and human continuation owners also differ between the standalone and combined revisions; whole-binary equivalence is not asserted. A security-owner decision is still required.
Earlier focused unit/static/build results remain evidence of their named historical revisions, not fresh checks of this head. The production-dispatch regression establishes the issuer mismatch and keeps authority objects distinct; the combined native captures extend that mechanism to allowed delivery and the nearest foreign-device refusal. No review approval or complete standalone proof is inferred.
Native child-send preparation revocation at preceding
42aff70aAn additional isolated, synthetic native-child control ran against exact preceding standalone
42aff70a9169d5043a4faf559f13c63bc248bb4f(source declares Codex 0.162.0; QA used the explicitly pinned 0.163.0 binary and a scripted local provider). The actual child-send preToolUse hook started, and its genuine metadata response was held unchanged. The original device credential was canonically revoked 88 ms after the hold; the identical response bytes were released 102 ms after the hold. The retained source cancelled the sender before that release; the exact native parent turn interrupted, and the runtime reportedoperator source authority is no longer active. The child received no guidance marker, no child-input write or send interaction was observed, and its original turn finished unchanged. Both native processes exited 0/signal:null; normal cleanup forwarded two SIGTERMs after all selected turn terminals; Gateway and provider joined.The collector exited 1, not a full passing capture: cancellation produced no matching hook/completed receipt, so its strict stopped-receipt observer failed and the QA owner retained task state for audit. This demonstrates source cancellation during genuine child-send preparation with no observed child input; it does not isolate the post-await guard, claim a completed tool-refusal receipt, or claim task-state removal. The separate canonical runtime build passed; the earlier full build remains blocked by the declaration-size budget.
Root independently checked the actual native hook start, metadata request/response correlation, canonical revocation receipt, cancellation timing, stopped child journal, native exits and all 276 frozen source/generated/fixture/binary pins.
{ "originalCollectorExit": 1, "originalCollectorQualified": false, "nativeSource": "0.162.0", "actualQaOverride": "0.163.0", "nativeHookStartedForExactSend": true, "realMetadataResponseHeld": true, "canonicalOriginalCredentialRevoke": true, "heldResponseByteIdentity": true, "timingRelativeHoldMs": { "canonicalRevocation": 88, "revocationReceiptObserved": 97, "originalBytesReleased": 102 }, "actualParentNativeTurn": "interrupted", "actualGatewayTerminal": "error/rpc", "actualSourceError": "operator source authority is no longer active", "sourceErrorLoggedAfterReleaseMs": 72, "targetChildGuidanceAbsentInStoppedJournal": true, "nativeChildInteractionsAfterArm": 0, "hostChildInputWritesAfterArm": 0, "nativeHookCompletionAbsent": true, "nativeProcessExits": [ { "code": 0, "signal": null }, { "code": 0, "signal": null } ], "gatewayProcess": "confirmed-stopped", "providerStopped": true, "cleanupObserverFailed": true, "taskStateRetainedForAudit": true, "limits": [ "No hook/completed tool-refusal receipt; original collector remains failed.", "Cancellation of live retained source during preparation observed; no isolated proof that post-await assertion rather than source abort propagation caused denial.", "State retained by canonical QA owner because stopped-receipt observer asserted; not process containment or forced termination." ], "sourceRevision": "42aff70a9169d5043a4faf559f13c63bc248bb4f", "normalCleanupSIGTERMForwardsAfterFinals": 2, "rootRawAnd276PinAudit": true }Hosted CI attribution
The actual tested CI merge was
aa9b9e15646651ec935a45aece51fde3220d3fcf, merging preceding standalone42aff70a9169d5043a4faf559f13c63bc248bb4finto45801179f6d99ffc1db9480320ef4bc189a4b8d7. The two failed jobs have incoming-base determining source:extensions/xai/xai-oauth.test.ts:675supplies{status:400}to the numeric-statusjsonResponsehelper. Both the tested test and helper blobs exactly match that incoming base.Root independently verified all five cached tested blobs against the incoming-base Git tree. This is source-based attribution, not a separately executed base types/browser reproduction or a claim that hosted CI is green. Those failures are not assigned speculative repairs in this authority PR.
Published evidence is allowlisted synthetic observations only; raw credentials, identities, endpoints, paths and transcripts remain private.
Historical combined local deployment (2026-10-20)
The operator explicitly opted into a combined local deployment containing main consolidation
7605b4fc8c28a628cd4d6b9a3e63bc9f1304ce10, reply-obligation candidate66eea4b4ef10f196ba1640398d186884d5557cdd, reconnect candidatede1dfafe07c8f0762b9e5fc16d4dfc6b36a3fbeb, and selected-requester candidate9600c93d45bbdb867ff738d258f25ea94a7f2f45, alongside existing local integrations and the separately restored saved-attempt UI work. The resulting local build is764886a56987d82f3a3934e2dd7d6a2416ef98da.Operational readback confirms the exact loaded build, readiness, health, Node 24, unchanged service environment, and all 25 previously active plugins. This is a combined integration deployment, not standalone validation of each PR or security/session-owner acceptance of any extracted policy. No new business-message, native-effect, revocation or reassignment proof is inferred from operational health. The earlier isolated traces below retain their recorded revisions, scenarios and failed-collector qualifications.