Repository navigation
Support OpenAI-compatible Codex model endpoints - #913
Conversation
|
🦞👀 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. |
e01d397 to
1165441
Compare
5309ae0 to
7d7a9a4
Compare
|
|
|
Free's clanker here (an AI agent reviewing on Free's behalf). This is a lighter pass, since the PR is a draft and the description says the dedicated k3d case still fails. Checked head 7d7a9a4 against main 10a9756. The merge with main is clean, including today's changes to Verdict: needs changes.
It also overlaps #925, #906, #851 and #875 in |
7d7a9a4 to
9958ef0
Compare
|
Free's clanker here (an AI agent reviewing on Free's behalf). Re-review of head 9958ef0 against main 2470aff (merge-base 4cda651). The branch was rebuilt as one commit on main; Resolved since the last review
Still blocking
Security review (not blocking) The credential path holds up. On the OpenShell path the Harness still gets only the Follow-ups worth a look, none blocking:
Verdict: needs changes. Trim the two docs pages and fix the stuck-record bug; the rest is follow-up. After those two, this is ready to land from my side. |
|
Free's clanker here (an AI agent reviewing on Free's behalf). Re-review of head 4a95cca ( Verdict: ready to land from my side. Both blockers from the last review are fixed, and the test gap is closed. Resolved
Local verification on the merged tree
Security pass (not blocking) The key still never reaches an unvalidated host. On the OpenShell path the Harness only holds the Optional follow-up
|
|
Follow-up from @sallyom’s k3d/OpenRouter test: This is emitted by stock Codex 0.158.0, not an API-key or routing failure. Codex lacks native metadata for this model and uses generic capability/context defaults. Suggested follow-up: have OCE provision a Codex-native catalog via |
Marking each entry (and moving the longest entries to the front) made a conflict with every open PR that adds a file to a Checks lane (openclaw#1370, openclaw#913). The lane now lists its audited files in parallelFiles, which also sets their start order (longest first, from main run 37308745808), and names serial-only files with a reason in serialFiles. File entries are unchanged, so a file a PR adds stays unlisted and runs alone. The audit rejects listed paths that are not lane files, duplicates, and files listed as both.
|
Free's clanker here. Heads-up: #2298 just landed on main and moved |
Preserve endpoint validation and native subagent routing alongside current credential lifecycle, ownership, workspace and readiness contracts. Co-authored-by: sallyom <11166065+sallyom@users.noreply.github.com>
3d1103d to
b2e8bac
Compare
|
@freeqaz @stevenlee-oai I believe everything has been addressed here, should be ready for a merge ty! |
# Conflicts: # apps/controller/src/drivers/credential-gateway/openshell.ts # docs/flows/credential-source-lifecycle.md # docs/reference/drivers/openshell-credential-gateway.md
Current verification (2026-10-13)
Head:
a57cde8b7d55e0ec67d2ae6c1d7f0b797bc9f6ac. Endpoint validation and source-ownership checks now fail earlier, while existing source profiles and recovery behavior remain supported.Summary
Support HTTPS OpenAI-compatible Responses endpoints for dedicated Codex Agents using Bearer API-key authentication.
config.base_urlto OpenShellopenaiCredentialSources. It defaults tohttps://api.openai.com/v1; custom profiles bind credentials to the normalized host, port, base path, and configured executable identities. Source endpoints remain immutable.runtime.codexModelBaseUrlfor Secret-backed dedicated Codex without OpenShell. Credential-source authentication uses its own endpoint instead of this Installation setting.--base-urland--model-idto the Codexscripts/k3d testand default/demo commands. Flags override inherited and prepared settings; credentials remain inOPENAI_API_KEY, with no key flag.Usage
With OpenShell, register an
openaiCredentialSource withconfig.base_urland bind the Agent usingcredential_source. Without OpenShell, configureruntime.codexModelBaseUrland use a Secret-backedapi_keybinding.For a manual Podman trial, set
OPENAI_API_KEYprivately to the endpoint's key and use fresh helper state to build the current images:The same model options work with the default foreground demo command.
--model-idtakes the endpoint's complete native model ID.Keep the state-directory selection for cleanup with
OCC_K3D_CONTAINER_ENGINE=podman ./scripts/k3d down --harness codex; this removes the recorded disposable cluster and database.Verification
Head at this historical checkpoint:
3d1103db7459691b2718de781abd4b28be4fff11, a topology-preserving refresh of3ecb541f6560a00554b4051c31ee978ed04a446b. Parents: unchanged90268463bbd255c3c13a0e0bdeb437728189eb1aand maind2fe579cd51f53bb979f0cb0f9ad8785b5f4585a; published tree2851db90d165f472deae1ee717be01b86ad5c772. Only the latest integration merge was recreated. All five earlier commits, including Kevin's merge, retain their exact identities; original merge authorship/date/message and Sally's co-author trailer are preserved. Publication used an exact-ref lease against the previous head.Execution-CA and endpoint integration (2026-10-11, head
3d1103db7)pnpm lint,pnpm format:check,pnpm typecheck,pnpm docs:check,pnpm openapi:check,pnpm check:workspace, the CI suite audit and three flow validators. Docs: 258 pages / 4054 links. Dependency manifests matched existing local installations; no installation was needed. The unchanged pre-push hook passed.0.160.0image was not substituted for0.163.0-alpha.2, and unchanged registry/attestation-trust failures were not retried. Go/gofmt and Compose/database prerequisites remain unavailable. No live inference, cluster, durability or full-image qualification is claimed. Previous-head CI is successful historical evidence for3ecb541f6, not this head.MERGEABLEwith merge stateBLOCKED. Exact-head CI, CodeQL, Observability Demo and QA Matrix Advisory are queued/running. No completed CI or merge-readiness claim. The final pre-push preview against maind2fe579cd51f53bb979f0cb0f9ad8785b5f4585awas conflict-free and identical to the published tree.Historical native-hook main integration (2026-10-10, head
3ecb541f6)Head at that checkpoint:
3ecb541f6560a00554b4051c31ee978ed04a446b, a topology-preserving refresh of0b5d7c9d6b825e1df836da67aed04f4dd3c9f8b8. Parents: unchanged90268463bbd255c3c13a0e0bdeb437728189eb1aand main73695fce6e0be52d79782d3d0d0a829315122fea; published tree9b81f022b9f0e260c0083352890abb2595679ea4. Only the latest integration merge was recreated. All five earlier commits, including Kevin's merge and the subagent-routing fix, retain their exact identities; original authorship/date/message and Sally's co-author trailer are preserved. Publication used an exact-ref lease against the previous head.400validators and projection before both current/earlier Gateway documents.tests/conformance/workspace-node-supervisor.test.mjsfor the current native-hook owner. These are source/API/Driver and supervisor-fixture checks, not packaged Codex or live-cluster proof.pnpm lint,pnpm format:check,pnpm typecheck,pnpm docs:check,pnpm openapi:check,pnpm check:workspace, the CI suite audit, three flow validators and whitespace checks. Docs: 256 pages / 4018 links. Dependency manifests matched existing checkout-local installations; no installation or toolchain change was needed. The unchanged pre-push formatting hook passed.0.160.0image was not substituted for the current0.163.0-alpha.2selection. Go/gofmt and Compose/database prerequisites remain unavailable. No live inference, cluster, durability, OS-base or full-image qualification is claimed. Successful previous-head CI belongs to0b5d7c9d6, not this head.MERGEABLEwith merge stateBLOCKED. Exact-head CI, CodeQL, Observability Demo and QA Matrix Advisory are queued/running; no completed CI or merge-readiness claim. The pre-push preview against newer main10a730e46ff594aa3d2b7157a382fb032325e39awas conflict-free (tree45921f6791fefce145b2201486699fa5ea703ea5); that newer main is not a parent of this commit.Historical Gateway document refresh (2026-10-10, head
0b5d7c9d6)Head at that checkpoint:
0b5d7c9d6b825e1df836da67aed04f4dd3c9f8b8, a topology-preserving refresh of37bfd913854df90a5c9c698d98efd457845576dd. Parents: unchanged90268463bbd255c3c13a0e0bdeb437728189eb1aand main58eddb3cb933336df87ea9984f063d0e59b9ce5c; published tree5f06e05e13e3c3549ce06d95339fe169d48e5871. Only the latest integration merge was recreated. The five earlier commits, Kevin's merge, original authorship/date and Sally's co-author trailer are preserved. Publication used an exact-ref lease against the previous head.400validators, endpoint normalizer, model/subagent compiler, plugin TOML renderer and native-peer fixture remain byte-identical to37bfd913.pnpm lint,pnpm format:check,pnpm typecheck,pnpm docs:check,pnpm openapi:check,pnpm check:workspace, the CI suite audit and three flow validators. Docs: 256 pages / 4017 links. Existing dependency graphs matched the manifests; no installation was needed. The normal pre-push formatting hook passed.0.160.0image was not substituted for the unchanged0.163.0-alpha.2selection. Go/gofmt and Compose/database prerequisites remain unavailable. No live inference, cluster, durability or full-image qualification is claimed. Prior-head CI, including its image jobs, succeeded for37bfd913; that is historical proof, not a new-head result.MERGEABLEand merge stateBLOCKED. New-head CI, CodeQL, Observability Demo and QA Matrix Advisory are queued/running; completed CI and merge readiness are not claimed. The pre-push preview against newer main19fcab36a6ad30ceb6de4ba4e13752bba982ad3ewas conflict-free (preview tree0a8c2745b11089fc5c5774205dea9a26123007c7); that newer main is not a parent of this commit.Historical topology-preserving refresh (2026-10-10, head
37bfd913)Head at that checkpoint:
37bfd913854df90a5c9c698d98efd457845576dd, a topology-preserving refresh of49cf10d40ee07a225ef7fcb0c44b3b1ee5ec1a33. Its parents are the unchanged PR tip90268463bbd255c3c13a0e0bdeb437728189eb1aand main100c0d7787d2fcd5f89812c52e26f4ee0ec2ccdf; published treea22aba08b7c3e9068e80a262b71e9f9e6c0d78d6. Only the latest integration merge was recreated. All five earlier commits, including Kevin's merge and the subagent-routing fix, remain byte-identical, with original authorship and Sally's co-author credit preserved. Publication used an exact-ref lease against the previous head.bearer-token/OAuth2 invalid values were returning404, contrary to the generic configuration-validation contract. Seven existing value validators now return field-specific400 INVALID_REQUEST; accepted values are unchanged, unoffered types retain409, and structural/catalog-field handling stays separate. The added API regression covers eight invalid field cases through real Fastify/IAM/OCC/OpenShell Driver admission, with remote gateway storage doubled: all failed with404before repair and pass with precise400details before Secret reads, record creation or gateway mutation. Runnode --test --test-name-pattern='offered OpenShell source values' tests/integration/credential-source-api.test.mjs; its nine reported tests include the parent and are already counted in 879. The existing direct-validator expectation was updated to the same error contract.pnpm lint,pnpm format:check,pnpm typecheck,pnpm docs:check,pnpm openapi:check,pnpm check:workspace,node scripts/ci/run-tests.mjs audit, three flow validators and whitespace checks. Docs: 256 pages / 4016 links. Final GPT-6 Astra P0–P2 autoreview and independent source review found no actionable issue in the published tree. The autoreviewer did not independently rerun tests. The unchanged pre-push formatting hook passed.runtime image spawns custom-provider subagents with intact native model IDsandruntime image validates the configuration dedicated native OpenClaw renders. Main pins OpenClaw90d30a1178a79dddd92e6190b66b95d89dfb3ca8, now with Codex0.163.0-alpha.2and its dependency patch. The available older image reports Codex0.160.0and was not substituted. Fresh current-recipe builds failed on registry connectivity and then package-attestation certificate validation; TLS and supply-chain checks were not weakened. The earlier two packaged checks and 806-test total below are historical, not proof of this head.MERGEABLEwith merge stateBLOCKED; CI, CodeQL, Observability Demo and QA Matrix Advisory are queued/running for this exact head. No completed CI result is claimed. The final pre-push merge preview against main100c0d7787d2fcd5f89812c52e26f4ee0ec2ccdfwas conflict-free and identical to the published tree.Historical additive main integration (2026-10-09, head
49cf10d40)Head at that checkpoint:
49cf10d40ee07a225ef7fcb0c44b3b1ee5ec1a33, an additive merge of PR head90268463bbd255c3c13a0e0bdeb437728189eb1aand main8e5a06cec7f622185222a8a7dbafe3b0a7228d9f. Published tree:450c98bd885abe95f65ab02217342b5733be7dd4. All existing commits, original authors, Kevin's merge contributions and Sally's attribution remain intact; no rebase or force push was used.409errors, withdrawal gates/rechecks, canonical native model/workspace setup, main-Agent roster admission and HTTP readiness, alongside this PR's field-specific pre-Secret400validation, absence-only cleanup fences, endpoint safeguards and explicit subagent routing. The model compiler, shared endpoint normalizer and native peer fixture are byte-identical to the preceding PR head. Both flow histories and Manual Notes are preserved.agents.ownership: "explicit". The fixture was corrected and the complete selection rerun; admission was not weakened.runtime image spawns custom-provider subagents with intact native model IDsverifies all four dispatches through real packaged Gateway admission and the Codex plugin to the synthetic native WebSocket peer.runtime image validates the configuration dedicated native OpenClaw rendersvalidates main's generated Gateway/worker configurations through production entrypoints and the actual image CLI; its model probe is replaced.pnpm lint,pnpm format:check,pnpm typecheck,pnpm docs:check,pnpm openapi:check,pnpm check:workspace, the CI suite audit, three flow validators and whitespace checks. Docs: 248 pages / 3945 links. The required GPT-6 Astra P0–P2 autoreview and independent source review found no actionable issue in the exact published tree. The autoreviewer assessed source and supplied evidence; it did not independently rerun tests. The normal pre-push formatting hook passed.pnpm cli:checkcould not complete because Go/gofmt are absent. Disposable PostgreSQL preparation viascripts/ci/prepare.mjs --lane postgres-applicationfailed because no Docker/Podman Compose provider is installed; no database suite passed or database resources were created. These are missing proofs, not passes or a waiver.90d30a1178a79dddd92e6190b66b95d89dfb3ca8source/archive and bridge patches. It does not requalify main's updated Debian/Node base or constitute fresh full-image qualification. The synthetic peer stops before inference. No live model response, fallback execution, cluster deployment, durability, database or Go proof is claimed by these runs. Historical runtime evidence below remains historical.MERGEABLE(no conflicts), with merge stateBLOCKEDand CI still pending; this is not a merge-readiness claim. Exact-head CI, CodeQL and Observability Demo have started; successful completion is not claimed. Native Container Verification was not selected. A read-only merge preview against newer main64dff25990334c8cf1e9372d5452c38cdcadfa61was conflict-free (preview treeb290b6933ca83bd321e7c3969ffb360d28d7f519); that newer main is not a parent of this commit.Historical subagent routing and endpoint naming follow-up (2026-10-09, head
90268463b)agents.defaults.subagents.modeland Agent-entrysubagents.modelthrough the existing endpoint projection, including string and primary/fallback forms. Add referenced child models to the projected catalog while preserving aliases (including aliases namedcodex/openai), omitted selectors, native IDs and admitted input.runtime.codexModelBaseUrlconsistently across its type/schema, callers, docs and tests, without a legacy alias. HTTPS OpenAI-compatible Responses and API-key-only limits are unchanged; unrelated OPENAI environment/protocol names remain intact.90d30a1178a79dddd92e6190b66b95d89dfb3ca8performs authenticatedsessions_spawnadmission, child dispatch and Codex-plugin native request construction. With the original compiler,thread/startreceivedmodelProvider=vendorandmodel=organization/default-child. After repair it receivesmodelProvider=openai-compatibleand the completemodel=vendor/organization/default-child. Default-string, entry-string, entry-primary/fallback-object and provider-named alias cases pass.ef3305feb26ea4231cf0dc398c6041a79b6fb914. No Go proof is claimed: Go/gofmt remain unavailable and no Go source changed.CONFLICTING/DIRTY. The exact-head Actions query shows ClawSweeper Dispatch (pull_request_target) only; normal PR CI has no run for this conflicting head. Earlier CI/runtime results below are historical, not current-head proof. The PR is not merge-ready.Historical rebase verification (2026-10-08, head
f9126efaa)Head at that checkpoint:
f9126efaada11f8cc18931aa8327f7e16cae59b6, a topology-preserving rebase ontoc8d4425227f75a6c580fedb952d63ac8920208a5. The original three PR commits are unchanged. The recreated merge preserves Kevin’s original author metadata and resolution work, with Sally’s co-author trailer retained on all four commits. Before publication, a read-only merge preview against newer main2dd0f01e0016abeccf38edef3e288f640c59f9b2was conflict-free; that later main is not the pinned rebase base.pnpm cli:checkcould not complete. PostgreSQL provisioning/worker suites explicitly skipped 144 cases because no disposable test database was configured; none are counted as passes. No live model, cluster, or OpenShell runtime suite was rerun.Historical endpoint host follow-up (2026-10-06, head
31b1b6a9a)400 INVALID_REQUESTwith/config/base_url. The upstream profile matcher treats brackets as character classes; no unproven glob-escaping fallback is used. Shared Compute URL validation still accepts concrete IPv6 literals.31b1b6a9a; it is not current-head CI evidence.Historical rebase verification (2026-10-06, head
129b9b988)11d3d04a1279781a770f6a6aa09e6322b064b80a; the author-reported runtime evidence below predates this rebase and does not prove the current runtime version.Historical original implementation evidence
Historical review follow-up (pre-rebase)
400 INVALID_REQUESTwith/config/base_url; no residual source is retained.pnpm docs:checkpassed after explicitly preparing the separate docs dependency graph: 241 pages and 3728 links. The two over-limit flows are now 2456 and 2484 words; Manual Notes are unchanged. All three changed flow validators passed.Work sessions: Original discussion with @sallyom · Implementation and verification.
Historical hosted verification (pre-rebase): CI run 37304740783 succeeded for head
4a95cca5b9b87c293dd6f68b3ae7a84ce1e5c541, testing GitHub merge revision2e60e624619233c92841ffe147cece96a9eb852fagainst main5a2dd43d2e524637e7173457def040fa79d42a93.CI Required, Static Checks, both Checks and Conformance lanes, and the selected PostgreSQL, k3d, image, and packaging lanes passed; Native Container Verification was not selected. CodeQL and Observability Demo also passed.Dedicated Codex with OpenRouter on Podman
Historical author-reported pre-rebase evidence; not rerun for the current head or runtime pin.
The PR author reported a passing manual run of the command above: 1 passed, 0 failed, 0 skipped, approximately 216 seconds. The run reused its prepared cluster, PostgreSQL database, and runtime images. OpenClaw reported
2026.9.7 (6f91eda)and the effective Gateway modelcodex/openai-compatible/z-ai/glm-5.3-flash.The selected real integration exercised:
This is dedicated Codex without OpenShell. The result is author-reported and was not independently rerun.
Remaining verification
The runtime gaps below are carried forward from earlier work; this follow-up did not rerun those suites.
gofmtremain unavailable locally, so the rebase’spnpm cli:checkcould not run. No Go source changed in this PR. The pre-rebase hosted lane passedpnpm cli:check && pnpm cli:test; that result is historical, not new-head CLI proof.Limits
Custom endpoints must use HTTPS, end in
/v1(including prefixes such as/api/v1), and support streaming Responses. URLs with hostname/path stars, port zero, credentials, queries, or fragments are rejected. OpenShell credential sources additionally reject bracketed IPv6 hosts; shared Compute URL validation retains IPv6 literal admission. The OpenShell source profile supplies Bearer authorization; customx-api-keyauthentication is outside this change. OAuth and account login modes retain their existing endpoint behavior. The Gateway receives no model credential; direct Secret-backed credentials remain confined to the Harness workload, and OpenShell-backed Harnesses receive only placeholders.