Repository navigation
fix(codex): preserve worker-owned native authentication - #192539
Conversation
Co-authored-by: galiniliev <[email protected]>
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves worker-owned Codex authentication and retains model authority before worker initialization. Example: A Full worker placement uses native-command authentication with a resolved Gateway availability key.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current worker-authentication failure, preserves existing authority boundaries, and has no concrete introduced defect identified. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Codex connection preparer translates an admitted agent run into a worker app-server connection, carrying model authority and cancellation while leaving credentials on the worker. flowchart LR
A[Admitted agent run] --> B[Codex connection preparer]
C[Model authority owner] --> B
B --> D[Authorized node duplex]
D --> E[Worker Codex app server]
E --> F[Worker native auth helper]
E --> G[Responses provider]
Technical reviewBest possible solution: Retain this focused repair using the existing worker handoff and model-authority lifecycle. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically sends worker native-command authentication to a handoff that rejects remote execution; the PR also reports baseline reproduction, but this review executed no target code. Is this the best way to solve the issue? The patch repairs the connection owner's routing and ordering directly, preserves non-worker restrictions, and needs no additional production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9341d60e90b6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +561, Other +4. Total +567 across 8 files. Added test files: 4. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 4, 2026, 2:06 AM ET / 07:06 UTC (Revision 4). |
Validate model authority before initialization can execute native worker authentication; add real native process proof. Co-authored-by: galiniliev <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Repair the exact PR-caused CI bookkeeping failure; production and behavior-proof code remain unchanged. Co-authored-by: galiniliev <[email protected]>
Keep worker credentials native while distinguishing unused availability data from explicit profile or supervision intent. Retain model authority before every worker initialization and correct task-wide process observation in the real Gateway/node proof. Co-authored-by: galiniliev <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
CI attribution for guarded landingThe remaining failure, I ran the normal snapshot check and generator on both CI’s actual merge All 62 jobs in run The current head |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
) Keep worker-hosted Codex authentication on its native owner. Treat resolved Gateway availability keys as non-forwarded discovery data while preserving explicit profile and supervision checks. Retain current model authority before initialization for all worker auth routes. Cover the shipped Gateway/paired-node/native-client path, including thread resume, worker-only credentials, revocation, cancellation and cleanup. Observe native children across all Linux tasks so worker-thread launches remain visible to the cleanup oracle. Co-authored-by: galiniliev <[email protected]>
What Problem This Solves
Fixes worker-hosted Codex authentication being handed back to Gateway auth, and ensures current model authority is retained before worker initialization can execute a native auth command.
User Impact
Workers keep their own native credentials. Normal Gateway model-availability resolution does not replace worker identity or block an otherwise valid worker turn. Explicit/forwarded Gateway profile choices and native supervision remain rejected. Model or placement revocation prevents the corresponding native effects. No configuration or migration is added.
Why This Change Was Made
Use the existing worker-owned handoff for native-command runs, and retain model execution through the existing authority owner before initialization for every worker auth route. A resolved Gateway key can be availability data, not a request to use that account on the worker; the worker handoff never forwards that key.
A full shipped-runtime replay caught the earlier revision incorrectly rejecting that normal availability key. This revision repairs that integration failure rather than changing the fixture to hide it. The Linux composition observer also now reads children across all node tasks, preserving its native-process filter and cleanup assertions; reading only the main task missed subprocesses created by runtime worker threads.
Evidence
Actual built Gateway + paired node + native Codex
The repository's supported network-none runner built
qaRuntimefrom the candidate and ran the existing full composition through real Gateway processes and authenticated node WebSockets:sessions.dispatch, then rejected the normal availability key before worker auth. This was an execution failure, not setup failure. Source snapshot:d68636b2dd9d070df0da735547f869ee904a59b89d5298b0d908c813f93e93b5.4291c8ce573583596adc030dd681bfda20995908ea056d26bd59e902ab84c034.The provider is deterministic loopback HTTP, not an external inference service. This proves the actual shipped Gateway/node/native-client composition, not cloud provisioning, live-provider behavior, or an upgrade.
Focused regression and review
node scripts/run-vitest.mjs run --config test/vitest.codex-worker-authority.config.ts --maxWorkers=1. An availability key still results in only the synthetic worker bearer reaching the provider. Model-policy and placement revocation prevent auth/provider effects; an explicit Gateway profile opens no worker duplex.test/tsconfig.codex-worker-authority.json), typed lint, formatting, diff and full-PR test-line gates passed. The shared baseline is unchanged.b93f6811d3f653f0fb83be4050d857fb9abbb111dfa2ce160563327daff7f306. Its inspected sibling auth-command source was pinned separately at8f73cdee456b6c46b791780d40cadf9d556d22a4; no source-to-binary provenance equivalence is asserted.