Repository navigation
fix: preserve OAuth inference and gateway rebuilds - #138696
freeqaz-openai wants to merge 10 commits into
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. |
|
Codex review: needs real behavior proof before merge. What this changesThe branch lets OAuth-selected Codex models reach native validation, prepares sandbox skill mount directories, preserves Control UI build identity and inference causes, and adds tests and recovery documentation. Review scores
Merge readiness⛔ Blocked before merge - 7 items remain Keep this PR open. Current main has only partial overlap with its fixes, but the pinned branch has two actionable defects that prevent a merge-ready verdict. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe Gateway resolves an agent’s model and prepares sandbox mounts before Codex or a container runs. Inference errors and build identity then reach Gateway clients and the Control UI. flowchart LR
A[Auth profile and model] --> B[OpenAI provider routing]
B --> C[Native Codex inference]
D[Workspace and custom binds] --> E[Sandbox mount preparation]
E --> F[Docker or browser container]
C --> G[Gateway response and Control UI]
F --> G
H[UI build metadata] --> G
Technical reviewBest possible solution: Pin directory preparation to an admitted canonical host source, bound nested inference diagnostics, and integrate the mount-chain repair with current-main workspace custody while retaining preservation-first collision recovery. Do we have a high-confidence way to reproduce the issue? Yes for the source-level OAuth and UI gaps; the PR also records historical before/after Docker controls. I did not execute a current-main reproduction in this read-only review. Is this the best way to solve the issue? No as submitted. The fixes sit in plausible owners, but host directory creation must retain the admitted source boundary and nested errors must retain a length cap. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 800bf8e10e7c. Merge-risk optionsMaintainer options:
SecurityNeeds attention: The new host directory write can resolve a custom bind source after its sandbox source-policy check. EvidenceSecurity concerns:
What I checked:
PR surfaceSource +117, Tests +678, Docs +43, Other 0. Total +838 across 18 files. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 (16 earlier review cycles; latest 8 shown)
Reviewed September 25, 2026, 6:04 PM ET / 22:04 UTC (Revision 17). |
e6c687a to
7de9162
Compare
7de9162 to
d7c4d43
Compare
Integrate the previously tested main revision and fix two CI fixtures. Use the existing 15-second completion setup allowance from #139176, keeping the cancellation scenario and succeeded assertion unchanged. Give agent-end context fixtures the adjacent controlled-clock and turn-start readiness pattern while preserving all terminal assertions. No production code or dependency versions change in this follow-up.
Propagate attempts that settle before turn/start and report the last observed fixture phase only on failure, preserving all terminal/context assertions.
Reuse the existing runtime-plan fixture so the synthetic workshop tool does not trigger unrelated provider discovery during startup. Preserve all context and terminal assertions, and remove the temporary timing observations now that the startup path is identified. Reuse the matching fixture correction from #139131.
Integrate main e09a265 after the completed PR CI run. Resolve the sibling setup-wait comment overlap by taking the canonical main fixture; its 15-second wait and assertions remain unchanged.
|
Hit this on a NixOS package of 2026.10.5. The package builds from the GitHub tag archive, which has no Reproduced on main (
With the equivalent one-line change in Main still has |
Related: #138595
What Problem This Solves
Fixes OAuth profiles blocking native validation of compatible account-specific Codex models, rootful Docker creating undeletable skill mountpoints, and UI-only rebuilds without Git metadata reporting a false Gateway build mismatch. Inference errors retain their cause without repeated wrappers.
The sandbox repair now prepares the full required mount attachment chain. Preparing only the final overlay source left Docker creating intermediate attachments as root. A custom bind above the workdir also redirects the workspace mount itself. All necessary attachments now receive host-owned directories before startup.
Why This Change Was Made
The existing owner follows strict ancestors from protected overlays through effective binds, including workspace attachment. It reuses segment-aware containment, deepest-parent selection and protected-target filtering; custom binds win at the same workspace target. Duplicate relevant targets fail before writes; unrelated targets receive no preparation.
Generic source/target/network/security admission precedes custom-root writes. Docker/Podman creation/restart and browser creation/restart/auto-start use their resolved configurations and binds. Mount order, hashes/epochs, running reuse and read-only overlays stay unchanged. No framework, config option, schema or SDK surface is added. OAuth fallback remains limited to compatible first-party ChatGPT routes; Platform credentials and custom endpoints retain their behavior.
Current dependency and data-model check
Independent inspection at
bcd5bad446eea7b136320acd2c927c3e1205c039rechecked the official fs-safe 0.8.1 archive against this head’s lockfile: archive SHA256effddeca2b5c8edddd0ac467169a4b7dc5b42f185556405b6c42b5c253f5f817, lock SHA256f774aba43551e277ce53215eed45081f9ddaced986e6267b7bcb7411685b1817. All 543 extracted files match the archive. The directory helper used by mount preparation and the canonicalization function retain byte-identical operational code from 0.7.2. Their current source/types and consumers were personally inspected.Existing executed 0.8.1 proof passes 13 published-export scenarios; four archive scenarios were also run against each version. Archive code is materially different: 0.8.1 preserves rejected hardlink destinations and finalizes directory permissions in those cases. Ordinary files remain overwriteable, merge is incremental, and new finalization errors may propagate. These are macOS/Node/native-off helper results; complete extraction, optional native binaries and a 0.8.1 installed Gateway were not proven. Exact 0.8.1 runnable proof supports a supplied official archive when registry access is unavailable. Historical installed Gateway/Docker evidence remains labeled 0.7.2.
Data-model check: no SQLite schema/version/table/index, serialized binding, mount hash/epoch or store-owner change. The production diff changes preparation/admission, the provider predicate, error text and UI-build identity normalization. Required directories can remain after later startup failure; preservation-first recovery and preparation beneath admitted
robinds follow the compatibility contract assessed below.User Impact and Recovery Contract
Missing attachment directories are created as the Gateway user in the actual backing source, including under custom
robinds:rorestricts container access while host preparation creates required directories. Custom sources must exist and pass admission. Existing contents, modes and ownership are preserved. Required empty directories may remain after a later image/version/engine failure.Files and all symlinks at required paths stop startup without replacement or target traversal. The recovery procedure covers pausing work, stopping containers, inspecting the selected source/attachment chain, moving the entry itself to an unused backup, and retrying. Bounded, escaped errors identify the relative suffix and containing container bind without host-source paths. Backups and symlink targets stay intact; other tools' data is not migrated. Compatibility decision: retain preservation-first recovery and host preparation under admitted
robinds. The technical readiness assessment accepts this bounded contract: replacing collisions or changing existing ownership would risk user data, while omitting preparation leaves rootful engines creating undeletable attachments. Container read-only enforcement is preserved.Managed hooks and protected native startup are in #138595. Both PRs target
mainindependently. No PR-specific dependency overrides are introduced.Review and owner involvement
The final technical assessment recommends this scope for landing. The PR author
freeqaz-openaiis a verified active member ofopenclaw/openclaw-secops, satisfying the repository's listed-owner involvement rule. Livemainrules require the passing CI gate and linear history; they do not require a separate independent approval. Existing review requests remain available. This assessment does not represent a newly submitted human approval or change the automated reviewer’s score.Evidence and Source Attribution
Candidate:
bcd5bad446eea7b136320acd2c927c3e1205c039. CI: normal CI passed, including the aggregate gate and both Windows lanes. Current-head checks report zero pending or failed checks. Earlier native and installed proofs retain their stated revisions.The fixture correction passed fresh independent P0–P2 review with no actionable findings. A separate full-tree verification accepts the mechanical main integration. Matching formatting, whitespace and assertion-conservation checks pass. The published commit is signed and passed the normal commit hooks.
Current CI evidence
The actual tested merge is
ad9af1d74a3ebfbec424219478a82d9f4ceee792, combiningbcd5bad446eea7b136320acd2c927c3e1205c039with main3e4becea5e2ce38ede69e8ecf5302805ecbfc09c. The merged agent-end test is byte-identical to the reviewed fixture.Hosted validation used Node 24.20.0, pnpm 12.3.4, and a successful frozen installation of fs-safe 0.8.1 and undici 8.10.2. These are observed current-run results. The earlier cold timings and test-order differences are retained in the work record; no isolated timing profile is claimed.
Mechanical main integration
The preceding fixture-correction head
ba48c9eeb6352f6573b689c5bc9e58526a2c9216passed full CI at test merge7a0b5037be5a04c05fa90477fd7930de38ef3a1c. Main then advanced from84b79be0d1f5556df5f4d131525c7a04f3b81db1toe09a265b11112623addd4de2167ee6b34cd82719. The sole conflict was two explanatory comment lines at the existing 15-second sibling setup wait; the canonical main file was accepted and now drops out of the PR diff. An independent conservation check confirms that the refreshed tree differs from the preceding green CI merge only in the same 15 files changed by main, with every changed blob identical to main and all remaining files identical to the tested merge. The runtime-plan test correction is unchanged. Matching formatting and staged whitespace checks pass; this integration adds no custom production behavior.Runtime-plan fixture correction
The agent-end context test now supplies the existing
createCodexRuntimePlanFixture. Its nonemptyskill_workshoptool otherwise falls back to provider discovery during startup. Supplying the prepared plan keeps this context test on the host-prepared tool-policy path already used by sibling fixtures. The change removes temporary agent-end phase diagnostics and preserves the controlled clock, startup readiness/error barrier, completed/aborted/refusal sequence, ten response iterations, and all eight assertions. No production code, product deadline, dependency, or workflow changes are added by this correction.The matching change in upstream PR #139131, introduced by df715579, passed all 148 tests across 12 Codex files, with the first completed case taking 3,558 ms, at upstream head
62d0b82cddc743a854e570fe2ebc124bfded35c2. The actual job log establishes that result; the overall upstream run had an unrelated failure. This supported selecting the correction; this PR's own validation is recorded above.Earlier diagnostics measured 139.7 seconds before
turn/starton managed023b95ef; general0dd80d15passed that case in 101.5 seconds against a 120-second limit. Those timings locate the delay but do not attribute its entire duration to provider discovery. Both fixture-correction heads and both refreshed heads passed their own normal CI; the corrected completed cases took about three seconds. These are observed CI results, not an isolated timing benchmark.The accepted #139176 sibling-setup correction is now also present on main: a 15-second succeeded-status wait, preserving the original cleanup order and cancellation/authority assertions. Dedicated deadline and settlement tests remain unchanged. Broader product work is deferred to separate PRs.
Prior normal CI at
0dd80d15passed, including both Windows lanes, on merge34be574347860bab6c8c82efa39e636a269f7119with main707edba619a6244fb6a465f9c4b01a856994a29c. That run passed the 148 Codex, 895 sibling-spawn, and 476 reclamation group tests; it predates this fixture correction.Local runtime/type checks remain unavailable because the configured registry policy blocks the required fs-safe 0.8.1 graph. Standard CI independently completed frozen installation with Node 24.20.0, pnpm 12.3.4, fs-safe 0.8.1, and undici 8.10.2. No registry or dependency-policy bypass is used.
The seven-layout proof below executes the corrected attachment-chain owner at
b2683104. Earlier Docker, installed-package, UI, and dependency proofs retain their stated revisions and scope.Final attachment-chain repair
rw; ancestorro; adjacent deepest parents; single deeprwwith default workdir; single deeprowith custom workdir; custom bind above workdir. All required attachments stay UID 1000; seven ordinary-user cleanups pass.EACCES, while overlays stayed read-only. Replaying the corrected owner makes all three pass. New chain regressions also failed before repair: 11 failed / 82 passed.The proof bundles actual resolution/preparation/mount-argument owners and security validation against published fs-safe 0.7.2 JavaScript. All 234 inputs stayed unchanged. Bundle SHA256:
1056e4adf47fe47855438ae7423e5d8192e85ad22880b8cd6a90a7e5b805e2fa. Execution completed exit 0; all containers/fixtures were absent without privileged fallback. Separate cleanup removed uploaded artifacts.122 focused tests pass; 179 sibling tests pass, one skipped, across seven suites. Canonical changed checks pass, including typing, all three unused-export scans and lint. Final independent P0–P2 review completed scoped-clean with no actionable findings. The final test-only fixture refactor also passed all 37 affected tests, focused lint and formatting checks; production/proof inputs stayed unchanged.
Installed Gateway integration
Four installed Gateway → native Codex → OpenClaw sandbox-tool → Docker turns passed with official Codex 0.153.4: initial execution, project-hook injection, reuse after injection, and Gateway restart/reopen. Every turn validates a random value available at the worker's mount path, its actual tool callback, a workspace file and completed authenticated Gateway response. Inspected mounts retain read-only skills and network isolation.
The actual tool set contains only
sandbox_exec/sandbox_process; stored bindings confirm native-tool restriction and protected native context. The same native thread and policy fingerprints survive reuse/reopen while restart replaces the native client/process. A separate native positive control executes user, project and the exact later-injected hook payload; after clearing those markers, all four Gateway turns run required managed hooks and suppress all three ordinary hooks.This is a canonical combined-candidate installation of core plus the external plugin, not either PR's standalone package. Deterministic loopback provider, synthetic credentials, fs-safe 0.7.2; no real OAuth/hosted inference. An independent reviewer checked the receipts. Gateway/provider processes, all task containers, transfer jobs and temporary remote state are cleaned up. Artifact/source details follow below.
Dependency and data boundary
The published directory owner creates missing segments under an admitted root without replacing conflicts; source canonicalization is path calculation, not ACL attestation. No serialized data or database schema changes. Pinned integrity, source links and the unchanged runnable proof follow.
The actual GitHub test merge also consumes upstream fs-safe 0.8.1. Its official artifact matches that merge's lock integrity; the used directory/canonicalization operational closures are byte-identical to 0.7.2. All 13 published-export cases pass on 0.8.1, plus four archive scenarios run against each version. Archive implementation changes are kept separate from that equality: 0.8.1 improves hardlink-destination preservation and final directory permissions in the exercised cases. This does not relabel the installed 0.7.2 package as a 0.8.1 Gateway proof.
Historical evidence and limits
rw/roand above-workdir attachments; the seven-layout proof supersedes it.d7c4d438f7: 18 rejections → 18 recoveries including restart; backups/source/targets preserved; nine ordinary-user cleanups; 54 overlay writes rejected; no containers left. This 231-input proof did not cover custom attachment chains.7de91626ec: omitted preparation produced UID 0 directories andEACCES. Initial disposal failed withoutDAC_OVERRIDE; separate scoped cleanup succeeded. Prepared paths cleaned up normally.3d35e5b3passed its aggregate gate, Windows suites and real-Gateway UI tests before this correction. It is not current-head CI.The seven-layout matrix covers mount owners/rootful Docker. Installed Gateway/browser evidence belongs in the separate section; real Podman/rootless/Windows engines, SSH/OpenShell, hostile concurrent alias retargeting, Windows ACLs, native fs-safe binary equivalence and complete archive extraction are outside this matrix. Recovery requires paused work and stopped containers; existing root-owned data is preserved, not repaired.
Preserved inference, UI, and build evidence
Preserved earlier inference/UI owners passed 399 focused tests in 11 suites, 17 native-required archive tests, 76 lifecycle cases, full build, and types/lint/architecture checks. These results retain their original scope.
The UI unread failure reproduced under sixfold CPU throttling and passed after adding the missing initial-load wait, with every acknowledgement assertion retained. A separate exact-merge dashboard fixture failure passed after restoring its omitted session-resolution response. All three related UI tests pass together. Before/after build execution verifies that UI rebuilds without Git metadata retain runtime identity. Earlier d7 CI is also retained as historical evidence.
Installed candidate identity
Local union
16f96489d39dc7ea08be8c26518c13efaa02037ccontains manageddab197ba3f2085642587dcc7257fa25814a3cc9dand generalb268310405c25d893bae1f0b6d5dae69f5b5c26fproduction. All 37,913 staged source files stayed unchanged during canonical build/packaging. One later test-only fixture refactor is recorded separately; that test is absent from the tarballs.Core SHA256
cff16a53a6de91ad40d8b36665f35e9f0cbaf480c4414ef9c44d833a5a4e69c3; external pluginc41090d5975f11a1b7c5c2ce85a37a74dfc492a1b1c4d998ce49a4c2fd7f5694; executed proof119dd61bf0866cf74c0254e5d4b65850b2e949cfe32f0f0b80ee4981d8d9cf71. Installed parity verifies 9,782 core payload files and 74 plugin files; the documented package lifecycle removes its separate pending sentinel. Four completed responses and eight main-phase provider POSTs passed. The nonce proves routing/effect, not secrecy from a malicious Gateway.fs-safe 0.8.1 published-export reproduction
This is the retained executed 0.8.1 script. Save it as
fs-safe-contract-proof-0.8.1.mjs, then runnode fs-safe-contract-proof-0.8.1.mjs /path/to/fs-safe-0.8.1.tgzwith the official artifact. It verifies the entire SHA512 before extraction and does not install packages or run lifecycle hooks. Omitting the path downloads the official archive where registry policy permits. Node >=22 andtarare required. Expected result: 13 passing scenarios; the original execution used Node v26.8.1/macOS arm64/native off. This independently reproducible helper proof does not execute a Gateway or a full archive extraction.Runnable 0.8.1 published-export script
Published filesystem contracts and runnable proof
The links below were independently fetched and byte-compared with public source revision
e9ab355341ecd47d3c5eeb523c5c8efd25587db9(v0.7.2). Runtime claims come from the published JavaScript, not a reconstructed implementation.lstatand reject files/symlinks, including in-root and dangling links. Directory preparation validates containment and creates missing segments without replacing collisions.entry-path,destination-not-directory,destination-symlink, anddestination-symlink-traversalcodes.realpathand rejoins a missing suffix. It calculates a path; it does not attest permissions or ACLs.sha512-Ls27+zwLKg7uomERaYeFFzKlhFH7A/T6PsQue/9JcLmJWS29041C/PcCaLH/r9Xajvk691EFkaNAq8lcKR75ew==; tarball SHA256:94fc96188d7466485a10d2ad994e12568ac2844419c491aee88952b4d0db85ee.Thirteen published-export scenarios passed on Node 26.8.1/macOS arm64 with native mode off: eight file/in-root-link/outside-link/dangling-link cases at leaf and ancestor positions, each rejecting, preserving, moving to a fresh backup, and retrying successfully; plus creation/reuse, traversal rejection, canonicalization, and structured archive errors. Outside targets/sentinels remain intact. This independent dependency check supports the helper contract; it does not substitute for the new consumer bind-selection proof.
Save the script below as
fs-safe-contract-proof.mjsin an empty directory and runnode fs-safe-contract-proof.mjs. It requires Node >=22 andtar, downloads only the official artifact, verifies its entire SHA512 before extraction, invokes published exports, prints JSON, and removes its own fixtures after success. Without registry access, usenode fs-safe-contract-proof.mjs /path/to/fs-safe-0.7.2.tgz; the same hash check applies.Standalone reproducible script