Skip to content

fix(codex): preserve worker-owned native authentication - #192539

Merged
roboclaw-bot merged 4 commits into
mainfrom
roboclaw/native-codex-auth-20261104
Nov 4, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
roboclaw/native-codex-auth-20261104

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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 qaRuntime from the candidate and ran the existing full composition through real Gateway processes and authenticated node WebSockets:

node scripts/run-vitest.mjs \
  --isolated-image sha256:847f71bbb3f17fc1032d50d75bf6fb3fdcf188b16dff81f24667fe9ae9409e01 \
  --isolated-runtime=bun run \
  --config test/vitest/vitest.e2e.config.ts --configLoader runner \
  test/e2e/qa-lab/runtime/codex-node-app-server.e2e.test.ts --maxWorkers=1
  • Red: the previous published implementation, with only the process-observer correction, built and reached actual sessions.dispatch, then rejected the normal availability key before worker auth. This was an execution failure, not setup failure. Source snapshot: d68636b2dd9d070df0da735547f869ee904a59b89d5298b0d908c813f93e93b5.
  • Green: the corrected candidate passed 1/1 full composition test (47.60 seconds test execution; 95.46 seconds Vitest run after the successful build). Source snapshot: 4291c8ce573583596adc030dd681bfda20995908ea056d26bd59e902ab84c034.
  • The test performs real worktree creation and worker dispatch, holds the actual native auth helper, observes worker-authenticated provider requests, starts and resumes the same native thread, reads the worker-owned thread store, and verifies persisted Gateway history and filesystem results.
  • It aborts a real held command and joins process cleanup. While auth is pending, ordinary reassignment remains refused because workspace results are pending; changing the actual session permission from Full to Workspace stops the captured run, helper and native children before their auth timeout. Late release and a subsequent forbidden attempt produce no provider requests or filesystem result.
  • Worker observations assert absence of Gateway/provider/forge credentials and runtime injection. The original assertions are retained; native children must stop before node shutdown.
  • The selected pinned Bun executable was verified by the runner. Preflight used Node 26.12.1, pnpm 12.15.0 and matching Chromium revision 1248. Both runs reported container absence after completion; no live Gateway was changed.

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

  • Original native-command handoff failure reproduced against the repository baseline.
  • Connection and environment siblings: 57/57 passed. The worker matrix includes resolved Gateway availability keys and verifies no host login/handoff; explicit profile/supervision conflicts still reject.
  • Actual native process/provider authority cases: 5/5 passed via 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.
  • Selected-leaf types (test/tsconfig.codex-worker-authority.json), typed lint, formatting, diff and full-PR test-line gates passed. The shared baseline is unchanged.
  • Fresh independent installed autoreview P0–P2: scoped-clean, covering the final delta with complete core auth producer, harness, transport and test context. Earlier reviews remain retained; the full runtime replay is additional executed evidence.
  • The native binary used in the focused proof is Codex CLI 0.164.0, SHA-256 b93f6811d3f653f0fb83be4050d857fb9abbb111dfa2ce160563327daff7f306. Its inspected sibling auth-command source was pinned separately at 8f73cdee456b6c46b791780d40cadf9d556d22a4; no source-to-binary provenance equivalence is asserted.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 4, 2026
@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Connection preparation reaches the local handoff and rejects remote execution.
  • After: The worker uses its native credentials, while explicit Gateway profiles and revoked authority remain rejected.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair with shipped-entry-point and authority proof; the failed prompt-snapshot check remains causally unclassified.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR records a built Gateway and paired-node replay through native Codex, with worker-authenticated provider traffic, continuation, cancellation, and permission revocation during held auth; focused native-process proof additionally shows model and placement revocation prevent auth/provider effects.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An otherwise valid worker-hosted Codex turn is rejected before using its own native authentication.
Reason: The maintainer-authored repair restores the established worker credential contract and protects initialization with the existing model-authority owner.

Regression provenance

Regression provenance — verified: source commit 3a195d3336ca by RoboClaw; canonical PR #186646 (blame-to-merge-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
Reviewed head: 843d1a23afb8d2767af9a197721dac3c4969b2af

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Worker authentication handoff keeps the original intent (3a195d3: Worker-hosted inference must use worker authentication and workspace rather than Gateway credentials.)
  • Model-execution authority lifecycle keeps the original intent (17d2faf: Native effects must remain bound to original and current operator model permission, including revocation.)
  • Native user-home credential ownership keeps the original intent (7e69b1d: Verify native accounts without injecting a stored Gateway profile into the user's Codex home.)
  • Worker process observation keeps the original intent (3a195d3: Observe helper and native-process cleanup before node shutdown; task-wide child enumeration retains that oracle when Bun spawns from worker threads.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 3a195d3 adds extensions/codex/src/app-server/run-attempt-connection.ts:388 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a195d3336ca; files: extensions/codex/src/app-server/run-attempt-connection.ts)
  • Shakker: Raw commit 17d2faf adds extensions/codex/src/app-server/run-attempt-connection.ts:423 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 17d2faf6b710; files: extensions/codex/src/app-server/run-attempt-connection.ts)

PR surface

Source +2, Tests +561, Other +4. Total +567 across 8 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 1 13 11 +2
Tests 6 587 26 +561
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 8 604 37 +567

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: A reproducible source failure blocks the optional worker-hosted native-auth route; the change also restores authority enforcement before initialization.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inspect the failed prompt-snapshot job to establish whether any repair belongs to this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-04T04:49:19.250Z sha df189db :: needs real behavior proof before merge. :: [P2] Construct a valid runtime plan for the native-command case
  • reviewed 2026-11-04T06:36:02.215Z sha cc480ca :: needs changes before merge. :: [P2] Reduce the allocation to the 245 counted added lines
  • reviewed 2026-11-04T06:43:59.356Z sha 23c0dce :: needs maintainer review before merge. :: none

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]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 4, 2026
Repair the exact PR-caused CI bookkeeping failure; production and behavior-proof code remain unchanged.

Co-authored-by: galiniliev <[email protected]>
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 4, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 4, 2026
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]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 4, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

CI attribution for guarded landing

The remaining failure, check-prompt-snapshots, is inherited from the exact CI base rather than this PR.

I ran the normal snapshot check and generator on both CI’s actual merge a33a6e1a2b8392ebc20d5bb9fcf954a875b1527c and its first parent 9341d60e90b639160fc89366badaf7ce0af59cb3, with separately installed frozen dependencies. Both fail on the same three tool-catalog JSON snapshots and generate byte-identical output. Parsed JSON equals the committed values in all three files: this is formatting drift. The generator and failing fixtures are unchanged by this PR. Local reproduction used Node 26.12.1 versus CI’s 24.22.1; that difference is retained in the evidence, not presented as identical runners.

All 62 jobs in run 41789246246, attempt 1, are terminal. This is the sole non-aggregate failure; security-fast passed. The failed job and downstream CI-gate result remain recorded as failures. No snapshot regeneration was committed to conceal the drift.

The current head 843d1a23afb8d2767af9a197721dac3c4969b2af has overall Platinum and passing real Gateway/paired-node/native-Codex composition, focused regressions and independent review. Landing will use the repository’s documented inherited-failure route, subject to its live writer, review, security, source and mergeability checks.

@roboclaw-bot
roboclaw-bot merged commit 8bc4454 into main Nov 4, 2026
119 of 123 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/native-codex-auth-20261104 branch November 4, 2026 07:22
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant