Repository navigation
fix(codex): native children fail with remote app-servers - #166400
Conversation
…ook-relay-1418 # Conflicts: # docs/.generated/config-baseline.counts.json # docs/.generated/config-baseline.sha256 # src/cli/native-hook-relay-cli.ts
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
|
|
Updated: the fixture qualification request is superseded. The test now constructs userinfo through the standard URL API using explicitly synthetic fields and separately asserts rejection of username-only, password-only, and combined userinfo. All 7 configuration tests pass; the complete updated test source passes pinned TruffleHog 3.97.4 with zero findings. Production code and scanner policy are unchanged. A fresh review is being requested for the updated head. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 7, 2026, 5:49 PM ET / 21:49 UTC. ClawSweeper reviewWhat this changesThe PR lets native Codex child processes call Gateway hooks across hosts using an explicitly configured HTTPS callback and a scoped credential file. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains useful: current main lacks the remote callback transport, and no blocking introduced defect was found. The verified maintain-access author also makes this ineligible for automatic closure. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin installs hook commands that native parent and child processes use to request OpenClaw policy evaluation. The new transport carries those requests from a remote Codex host to the existing Gateway relay owner. flowchart TD
A[Remote callback configuration] --> B[Codex plugin]
B --> C[Scoped credential file]
C --> D[Native child hook command]
D --> E[Gateway HTTPS callback]
E --> F[Token and live owner checks]
F --> G[Existing hook policy]
G --> H[Allow or deny result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +475, Tests +694, Docs +27, Generated 0. Total +1196 across 35 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep remote transport opt-in, with the existing relay owner enforcing policy and lifetime and the deployment supplying a private credential directory and HTTPS routing. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure mechanism: remote hook commands reference the Gateway-local database and loopback relay. No current-main runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes, the opt-in transport reuses the existing policy and lifetime owners instead of introducing a second authorization path, and preserves the default local behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d4a2e61910a4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
The data-model migration checklist is not applicable to this change. In The new credential file is a disposable projection owned by a live relay generation, written on preparation and removed on retirement. No existing database schema, session record, or authoritative stored format changes. Without the opt-in callback configuration, the existing local transport is retained. The recorded full local deployment used the unchanged Codex 0.160.0 binary and exercised this write/remove path. This agrees with the review’s own compatibility evidence that no authoritative stored-data format is rewritten. Disposition: no migration or migration code is required. Current-head required CI is green, and the completed review reports no actionable code or security findings. |
25 upstream commits, none of them in extensions/feishu. openclaw#166400 adds three settings to the Codex plugin manifest, which moves the plugin config baseline from 4524 to 4527 entries. docs/.generated/config-baseline.counts.json and config-baseline.sha256 conflicted only because both sides regenerate them. The merge took upstream's copies and regenerated all three generated files from this merge. build:docker ran in a separate detached checkout of this commit. Counts are core 2495, channel 3876 and plugin 4527. The core and plugin hashes match upstream/main, and the channel hash is the same as the previous branch head. The generated metadata differs from upstream/main only by the two Feishu markdown.tables entries. The three generated-file checks pass there. config/test-mock-exports-baseline.txt and test/vitest/vitest.extension-database-workers-paths.mjs changed on both sides and merged without conflict. Each keeps upstream's change and this branch's one line. Feishu: 102 files and 1523 tests in the extension project, 17 files and 218 tests in the database-workers project, all passing. The forwarder test and the routing guards pass, 503 tests. tsgo:core, tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines, assertion-safety, database-worker, test-timeout-race and test-mock-exports ratchets against upstream/main, oxlint and oxfmt on the 43 changed code files all pass.
What Problem This Solves
Native Codex children cannot call OpenClaw hooks when the Codex app-server and Gateway run on separate hosts: the inherited hook command refers to the Gateway's local relay database, which is absent on the Harness.
Related: openclaw/openclaw-enterprise#1418. Companion OCE routing and runtime pin: openclaw/openclaw-enterprise#1574.
User Impact
Remote Codex sessions can spawn a native child, wait for it, and receive its result while retaining Gateway hook enforcement. Shared developer instructions, including the shared persona, remain inherited by native children. This uses stock Codex 0.160.0 and requires no Codex change.
Why This Change Was Made
An explicitly configured HTTPS callback delivers hook requests to the existing Gateway relay. The Gateway projects a per-relay, per-generation capability through the app-server filesystem API and removes it when the owner retires. The callback authenticates that capability and runs the existing hook/policy path; it does not grant operator RPC access. Remote callback failure does not fall back to local state or operator credentials. Local app-server connections keep their existing relay path.
The remote credential is readable by the Harness user and is scoped accordingly; this is not protection from a fully compromised Harness impersonating its own hooks.
Parent wake/restart semantics (#166349) and persistent child activity history (#166350) are separate follow-ups. This PR does not change those contracts or claim to fix existing duplicate background notifications.
Evidence
c6698b1e9b2, PR head68cf8c9aa38): regenerated the conflicting config documentation digest; config baseline validation, extension production typecheck, and 33 focused configuration/relay/warm-thread tests passed (5 files, 92.11 seconds total).699a3c58bf2: 12 focused hook files, 156 tests passed. Coverage includes callback authorization, policy denial, TLS, credential projection, owner retirement, and normal/incognito warm-turn refresh.check-changedvalidation against main699a3c58bf2passed on5ba8d5e5b76, including types, lint, docs, ratchets, and security boundary guards.43a7333aa04with the OCE companion in a full local installation with dedicated Codex andcodex_pat. Verified native spawn/wait/result, shared persona in the child developer instructions, a successful native child command, and a subsequent turn on the same parent thread retaining context.The userinfo rejection tests construct URLs through the standard URL API with explicitly synthetic fields, covering username-only, password-only, and combined userinfo. The focused configuration suite passes all 7 tests (10.70 seconds including the repository wrapper); formatting and the pinned TruffleHog 3.97.4 scan of the complete test source pass with zero findings. No scanner policy or production behavior changed.