Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 18, 2026, 2:08 AM ET / 06:08 UTC. ClawSweeper reviewWhat this changesAdds automatic macOS Codex activation, persisted prepared-auth handling, and dynamic model-catalog discovery for the macOS onboarding and agent runtime. Merge readiness⛔ Blocked by patch quality or review findings - 10 items remain This PR remains necessary, but it is not ready to merge: receipt-backed recovery of a fresh activation can skip custodian onboarding, and paginated model discovery can exceed its advertised timeout. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) Assertions:
How this fits togethermacOS onboarding activates a prepared model setup, verifies its durable activation receipt, then routes new installations through custodian onboarding or existing installations to the dashboard. The Codex plugin discovers account models for the picker and selected agent runtime. flowchart LR
A[macOS first launch] --> B[Prepared model activation]
B --> C[Activation receipt verification]
C --> D{Activation ownership}
D -->|Fresh or recovered| E[Custodian onboarding]
D -->|Pre-existing setup| F[Dashboard]
B --> G[Codex model discovery]
G --> H[Model picker and agent runtime]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +451, Tests +525, Other -93. Total +883 across 36 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve activation-receipt ownership through handoff selection, enforce one discovery deadline across pagination, document the public harness callback, then rerun focused macOS and Codex coverage with the Codex app-server contract available. Do we have a high-confidence way to reproduce the issue? Yes, from source: seed and verify an owner-bound completed activation receipt after relaunch, then observe the plain-dashboard handoff; paginate delayed model-list responses to exceed the configured total timeout. Is this the best way to solve the issue? No. Selecting by existing-model kind loses activation ownership, and applying the timeout independently per request cannot satisfy the documented total bound. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1c3e512096bc. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
18a6921 to
5d4c01d
Compare
5d4c01d to
01060a0
Compare
# Conflicts: # scripts/plugin-sdk-surface-report.mts # ui/src/pages/chat/chat-view.test.ts # ui/src/pages/chat/components/chat-model-controls.ts # ui/src/pages/chat/components/chat-model-picker.ts # ui/src/pages/new-session/model-control.test.ts
The manifest documents discovery.enabled (bundled fallback list) and discovery.timeoutMs (default 2500ms) for model discovery; the new catalog path used the generic 60s request timeout and ignored the enable gate. Also drop the test-only listModels injection seam in favor of vi.mock.
configureCodexCliPreparedAuth silently rewrote an explicitly configured websocket/unix app-server to local stdio (keeping a dangling url), moving the credential boundary onto this host. Fail setup with actionable guidance instead; also surface the root cause when the prepared model catalog refresh fails after activation.
Three near-identical key helpers existed (models-list-result, models-list-configured-static, harness/model-catalog). Export resolveModelCatalogIdentityKey from the route-policy owner, collapse the duplicate dedupe loops into dedupeByKey, make donor enrichment Map-based, and inline the one-off harness-augment wrapper.
Landing every finish on the plain dashboard stranded the custodian first-run flow (memory import, channels, permissions, hatch). Fresh activations now hand off to custodian onboarding; live-verified pre-existing setups reopen the normal dashboard, matching the removed already-configured shortcut. Tests pin the destination per path. Also isolate the post-startup Codex login test from developer machines: ambient OPENAI_API_KEY and a real Codex login made it assert-fail.
|
Merged via squash.
|
* fix(setup): refresh Codex registry with staged install * fix(macos): verify inference before onboarding handoff * fix(setup): use native Codex home for subscription auth * fix(codex): honor attempt-scoped setup config * fix(macos): align onboarding handoff with reopen * fix(setup): await prepared model convergence * fix(ui): avoid false auth state for empty catalog * fix(setup): scope catalog convergence to Codex gateway * fix(setup): publish the committed runtime catalog * fix(models): project configured static runtime models * fix(codex): expose app-server model catalog * fix(models): preserve Codex auth across reloads * fix(ci): align Codex onboarding checks * test(ui): stabilize dock suppression environment * fix(codex): honor discovery config in app-server model catalog The manifest documents discovery.enabled (bundled fallback list) and discovery.timeoutMs (default 2500ms) for model discovery; the new catalog path used the generic 60s request timeout and ignored the enable gate. Also drop the test-only listModels injection seam in favor of vi.mock. * fix(setup): refuse prepared Codex auth over an explicit remote transport configureCodexCliPreparedAuth silently rewrote an explicitly configured websocket/unix app-server to local stdio (keeping a dangling url), moving the credential boundary onto this host. Fail setup with actionable guidance instead; also surface the root cause when the prepared model catalog refresh fails after activation. * refactor(agents): one canonical model-catalog identity key Three near-identical key helpers existed (models-list-result, models-list-configured-static, harness/model-catalog). Export resolveModelCatalogIdentityKey from the route-policy owner, collapse the duplicate dedupe loops into dedupeByKey, make donor enrichment Map-based, and inline the one-off harness-augment wrapper. * fix(macos): restore custodian handoff for fresh activations Landing every finish on the plain dashboard stranded the custodian first-run flow (memory import, channels, permissions, hatch). Fresh activations now hand off to custodian onboarding; live-verified pre-existing setups reopen the normal dashboard, matching the removed already-configured shortcut. Tests pin the destination per path. Also isolate the post-startup Codex login test from developer machines: ambient OPENAI_API_KEY and a real Codex login made it assert-fail. --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes first-run macOS onboarding treating an implicit model label as working AI, leaving native Codex credentials unusable during activation, handing users to a different surface than normal reopen, and exposing only the single persisted Codex model instead of the account's current app-server model catalog. It also preserves the working Codex OAuth and account model catalog across later configuration reloads, such as switching the default model or updating the agent identity.
Why This Change Was Made
Onboarding now live-verifies effective inference, activates Codex against the native user home, publishes the committed runtime generation, and lands on the normal Dashboard. Explicit model-picker reads ask the selected agent harness for its account-scoped catalog; the Codex harness projects app-server
model/listrows into OpenClaw's prepared catalog while preserving static metadata and alternate physical routes. Replacement runtime owners merge external-auth overlays over the durable auth store instead of allowing an empty authoritative overlay to erase durable OAuth. Chat startup and preloaded metadata reads remain on prepared facts and do not wait for live discovery.User Impact
Users with an existing Codex or ChatGPT subscription can complete macOS onboarding without signing in again. Setup activates the detected Codex route automatically, opens the normal Dashboard without a false authentication warning, and the model picker can show the Codex models currently available to that account. Those credentials and model rows now survive later hot reloads and relaunches.
Evidence
pnpm test src/agents/prepared-model-runtime.auth-store.test.ts src/agents/prepared-model-runtime.test.ts src/agents/prepared-model-runtime.lifecycle.test.ts src/gateway/server-methods/models-list-result.plugin-runtime.test.ts src/gateway/server-methods/models-list-result.openai-routes.test.ts src/gateway/server-methods/models-list-result.configured-static.test.ts- 109 tests passed after merging currentorigin/main.pnpm lint:core- passed after merging currentorigin/main.pnpm build- passed after merging currentorigin/main, including plugin SDK export validation and the Control UI build.pnpm test src/system-agent/setup-inference.test.ts extensions/codex/harness.test.ts ui/src/pages/chat/chat-view.test.ts- 416 onboarding tests passed for the earlier feature changes.swift test --package-path apps/macos --filter OnboardingAISetupTests- 94 tests passed for the earlier feature changes.swift test --package-path apps/macos --filter OnboardingSystemAgentChatTests- 15 tests passed for the earlier feature changes.swift test --package-path apps/macos --filter MenuContentSmokeTests- 8 tests passed for the earlier feature changes.agentHarnessId: codexwithout reroute or fallback.Basesnapshot, installed the self-contained app, and completed onboarding from the bundled OpenClaw 2026.8.1 / Node 24.15.0 runtime.agentHarnessId: codexwithrerouted: false. The picker still returned eight account models with no unavailable rows, OpenAI OAuth remainedok, and the Codex runtime auth route remainedusable.origin/main,pnpm tsgo:prod,pnpm check:test-types,pnpm test:extensions:package-boundary:compile,pnpm deadcode:report, andpnpm plugin-sdk:surface:checkpassed.pnpm lint:core,pnpm lint:extensions,pnpm format:check, andswift build --package-path apps/macos --product OpenClawpassed.Maintainer Rework (steipete)
Review found the feature direction sound (live-verified onboarding, auth-store overlay merge at the replacement-generation owner, harness
loadModelCataloghook with a justified +1 SDK surface budget; the projection matches the Codex app-servermodel/listcontract incodex-rs/app-server-protocol/src/protocol/v2/model.rs). The following issues were fixed on top:apps/macos): landing every onboarding finish on the plain dashboard stranded the custodian first-run flow (memory import, channels, permissions, hatch). Fresh activations now hand off to/custodian?onboarding=1; live-verified pre-existing setups reopen the normal dashboard (matching the removed already-configured shortcut). Tests pin the destination per path.extensions/codex/src/app-server/model-catalog.ts): the manifest documentsdiscovery.enabled(bundled fallback list) anddiscovery.timeoutMs(default 2500 ms); the catalog used the generic 60 s request timeout and ignored the gate. Nowenabled === falsereturns no live rows (static catalog stands) and the list call is bounded bydiscovery.timeoutMs ?? 2500.src/system-agent/setup-inference-plan-helpers.ts): prepared Codex auth silently rewrote an explicitwebsocket/unixapp-server to local stdio (keeping a danglingurl), moving the credential boundary onto the local host — pre-existing on main, but this PR widened it withhomeScope: "user"and asserted it in a test. Setup now fails with actionable guidance and leaves the config untouched; regression test updated.resolveModelCatalogIdentityKey(three near-identical copies existed),dedupeByKeycollapses two duplicate merge loops, donor enrichment is Map-based, the one-off harness-augment wrapper is inlined, the test-onlylistModelsinjection seam is dropped forvi.mock, and the post-activation refresh error now preserves its root cause.OPENAI_API_KEYor a real Codex login (live discovery reached the real app-server). It now stubs the env key and disables discovery for that scenario.offlinestatus,noModelsAvailable) is a strict superset of this PR's empty-catalog fix; all UI files resolve to main's side. SDK surface budget merged to 4332.Known tradeoff: explicit (non-prepared)
models.listreads perform a live boundedmodel/listper request; the Control UI caches for 60 s with in-flight dedupe and codex caches its catalog for 5 min upstream, so no gateway-side cache was added. The bundledrunAttemptnow prefers attempt-scoped plugin config over the launch snapshot (resolveAttemptPluginConfig), which is what keeps the account catalog and OAuth usable after hot reloads.Maintainer Evidence
swift test --filter "OnboardingAISetupTests|OnboardingSystemAgentChatTests|OnboardingViewSmokeTests": 135 tests, 3 suites, all passed.check:changedfull lane green (format, tsgo core+tests, lint, guards, SDK surface budget, dead-export scan);pnpm buildgreen.OPENCLAW_STATE_DIR=/tmp/oc-live-124829, port 19923, real ChatGPT-subscription Codex login,homeScope: "user"):models.list view=configured refresh=truewith discovery enabled returned the account's 7 Codex models (gpt-5.6-sol/terra/luna, gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.2) with per-model reasoning-effort lists projected from livemodel/list, allavailable: true,agentRuntime: codex.discovery.enabled=falsein config (hot reload) degraded the same call to the static bundled catalog (includesgpt-5.3-codex-spark/gpt-daybreak-blue-latest, absent from the account list) — and OpenAI rows stayedavailable: trueacross the reload, proving durable OAuth survives replacement generations.openclaw.chatthrough the codex-routed session (model: gpt-5.6-terra,agentRuntime: codex) returned the exact requested marker.