Skip to content

fix(cli): avoid local startup validation for Gateway model runs - #158136

Merged
VACInc merged 7 commits into
openclaw:mainfrom
VACInc:fix/infer-gateway-startup-state-lock
Sep 27, 2026
Merged

VACInc merged 7 commits into
openclaw:mainfrom
VACInc:fix/infer-gateway-startup-state-lock

Conversation

@VACInc

@VACInc VACInc commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

High Level TLDR

Gateway-backed model runs now validate client configuration without preparing local shared state. Both infer model run and capability model run use Commander-parsed transport options, so prompt text such as --local cannot change the startup path.

What Problem This Solves

Fixes: Gateway model commands can enter local startup preparation, and flag-shaped prompt values can make preparation disagree with the selected transport.

User Impact

Gateway runs use non-observing config validation. Default/local runs retain their existing preflight. No new configuration, permissions, schema, or migration is introduced; explicit Doctor remains the repair owner.

Why This Change Was Made

Root Cause

The original catalog omitted model-run startup policy. The initial raw-argv correction then confused option values with transport flags. The registered action selects transport from parsed Commander options; startup now consumes those same facts. Earlier negative-control testing reproduced six failing routing cases before the correction.

Verification

Current candidate

Published head: f056c528db3b32728b2e48404f19a81adf79d223; tree: d9eee5027193cd6e9e9bcff5ed7a456bb716e9fc.

  • Merged main ad76f83efaa0b21b9eda589ea681807d124de68b to resolve the actual generated Workboard manifest conflict. The manifest now matches main exactly; the canonical Workboard asset generator reproduced it without changes. Original contributor ancestry and VACInc coauthor credit are preserved. The net candidate is seven files.
  • Fresh independent P0–P3 autoreview of the complete reconciled candidate: scoped-clean, no actionable findings, confidence 0.86. Supplied owner/caller source was inspected; the reviewer did not execute tests.
  • Fresh startup/config boundary validation: 169 tests passed across three files, including both aliases and flag-shaped prompt values, in 24.71s wrapper wall / 23.11s Vitest on Node 24.19.0. Command: node scripts/run-vitest.mjs src/cli/program/preaction.test.ts src/cli/program/config-guard.test.ts src/cli/command-startup-policy.test.ts --maxWorkers=1.
  • Test-audit: retained parser-boundary regressions and target-frame assertions protect observable behavior; no coverage, deadline, assertion, or retry policy was weakened.
  • Deslop: the seven-file diff needed no further cleanup; browser diagnostics remain bounded and failure-only.
  • Current-head changed static checks passed, including core and test types, formatting, lint, ratchets, dead exports, and architecture guards. Exact-head hosted CI passed on f056c528db3b32728b2e48404f19a81adf79d223. An initial pre-commit ratchet attempt selected the old HEAD merge base while the merge was uncommitted and reported an untouched backup test; after committing the reconciliation, the correct-base line-cap ratchet passes. This was a check-context failure, not a source repair or passing full gate.

Hosted test cost

  • src/cli/program/preaction.test.ts: 90/90 passed; 5.16s CI wrapper wall / 3.62s Vitest, in checks-node-changed-3. Prior standalone one-worker wall cost: 59.16s.
  • ui/src/pages/plugin/plugin-page.session-navigation.browser.test.ts: seven Chromium cases passed; 0.813s test execution / 1.394s module elapsed, in checks-ui (2/3). Prior standalone one-worker wall cost: 2.50s.
  • src/tui/tui-pty-harness.e2e.test.ts: retained standalone one-worker cost 121.86s for 72 tests. No per-file timing for this file was present in the inspected current CI changed-node/UI shard logs; no new standalone cost claim.

Real behavior proof

Retained proof on previous published head 7f5985d87c724e94e92c0e150bbb79a38bbd8455: four model calls through disposable isolated Gateways passed across fresh and Doctor-migrated synthetic fixtures, covering both aliases and a --local prompt value. Four synthetic provider requests were observed; Doctor exited zero and migrated session identity/timestamp and cleanup were verified. Total: 34.466s. The parsed transport fix remains unchanged; this is previous-head synthetic-provider proof, not a new current-head runtime or production claim.

What was not tested

No production deployment, live Gateway change, real-provider latency benchmark, or successful full native suite is claimed. The previous full-suite controller received SIGTERM/exit 143; its allocation was terminal and its lock recovered. Prior build/static/UI-budget results are historical evidence, not current-head CI.

Browser readiness diagnostics do not prove a fix for #159679. The retained TUI fixture correction addresses append-only redraw history as documented in #159777. Earlier attempts and measured changed-test costs remain below.

Evidence

ClawSweeper revision 24 completed on exact head f056c528db3b32728b2e48404f19a81adf79d223 at 19:58 UTC: no actionable findings, no before-merge items, ready for maintainer review. It explicitly confirms the parsed-options correction resolves the prior finding. Exact-head CI completed successfully; both enforced CI/security gate statuses passed. Native merge reconciliation verified the exact attempted head landed as ddc8ebeabfe04dcffe70d38e21114049f385f1f8 on September 27 at 20:06 UTC. Original implementation and incident report: @VACInc.

Retained earlier evidence and interrupted validation history

Published for handoff; full validation remains incomplete. The PR now contains exact reviewed commit 7f5985d (tree 8bc47d0aa646bda89a45c4ed113aed60de30a973), pushed as a normal fast-forward by roboclaw-bot at the contributor’s explicit direction. The signed incoming ancestry and VACInc coauthor credit are preserved; the two new commits are unsigned. Exact-candidate build/static checks, isolated Gateway proof, asset checks and UI budgets passed. The full native suite was interrupted by SIGTERM/exit 143 and has no successful completion receipt. Current-head hosted CI and fresh review remain pending. This is source publication for handoff, not a merge or a claim that all gates passed.

What Problem This Solves

Fixes: Gateway-backed model commands enter local startup validation, and flag-shaped prompt values can select the wrong validation path.

User Impact

infer model run --gateway and capability model run --gateway use non-observing client config validation, including prompts such as --local. Local/default runs retain normal startup validation. No new flags, configuration migration, or user action is required.

Why This Change Was Made

Startup now uses the transport options actually parsed by Commander rather than scanning prompt text for flag tokens. Both command spellings share the decision. Main already confines legacy imports and repair to explicit Doctor through #151025; this change preserves that ownership and keeps RPC clients out of local startup preparation.

Original implementation and incident report by @VACInc; contributor history is preserved.

Evidence

  • Current reviewed candidate: 7f5985d, tree 8bc47d0aa646bda89a45c4ed113aed60de30a973, preserves signed incoming head 216a9a4. Its complete eight-file net diff passed fresh independent P0–P3 source review (two passes, zero findings, scoped-clean; confidence 0.81). Review used supplied source context; it does not substitute for executed gates. Test-audit and deslop preceded the review. The incorporated startup-cleanup dependency passed 165 affected tests across five files in 66.72s. Native validation and read-only merge simulation against captured main 3d62d4e passed.

  • Generated asset reconciliation: the fresh build exposed two stale Workboard asset references in the updated base. The generated manifest now exactly matches canonical main fix 559b4f84; no plugin permission or capability changed. The unchanged build hook reproduced the same output, and full pnpm plugins:assets:check passed with a clean tree after commit. The superseded attempt was stopped before any remote allocation; its runtime prerequisite correctly refused the dirty tree before starting a Gateway. That refusal is not reported as runtime proof or a full gate pass.

  • Current exact-candidate runtime proof: all four concurrent model calls succeeded through real disposable Gateways on 7f5985d, across fresh and explicit-Doctor-migrated synthetic legacy fixtures. Both command aliases were exercised, including a prompt value of --local. Four synthetic HTTP provider requests were observed; public sessions.list checks retained the migrated session ID and timestamp. Doctor exited zero and both disposable environments cleaned up. Total proof wall time: 34.47s. Network/PID isolation excluded the operator Gateway and real provider credentials; this is runtime correctness proof, not external-provider latency evidence.

  • Current build and budgets: native build passed in 6m 10.4s and left the committed tree clean. The CI-equivalent pnpm ui:check-performance:base 574927f comparison passed on exact candidate 7f5985d in 44.27s: startup JavaScript 371,162 B under the unchanged 371,332 B limit, largest ordinary chunk below 215 KiB, and zero startup/largest CSS delta. The canonical normalized build identity resolves the raw build's report-only advisory without changing budgets. The new full native run began at 17:14 UTC: native build and complete static checks passed. The full 679-shard Testbox attempt used parallel projects/max workers both 2. Its local controller was interrupted by SIGTERM around 19:14 UTC and reported child exit 143; the local test log stopped advancing and no successful delegated timing report or native gates.env was produced. The provider still reported the lease ready during recovery inspection; allocation readiness is not workload completion. The operation lock was initially retained. After the provider reported the Testbox completed and the recorded local tools were absent, it was recovered using the native exact-token command before the later handoff push. No duplicate tests or source edits were performed. Its applied source capsule explicitly verifies candidate 7f5985d and tree 8bc47d0aa646bda89a45c4ed113aed60de30a973 (carrier f9a3e0d60b450bf65d044a7efda9509e5844bd81). The Actions workflow SHA is hydration metadata, not the tested candidate. No full-suite success is claimed.

  • Signed-base integration checkpoint (before the current generated refresh): GitHub produced head 216a9a4 at 16:19 UTC, preserving the prior head and incorporating main 574927f. Its signature and ancestry were verified. All eight correction-delta files composed on it are byte-identical to reviewed local candidate d27ef07; the net PR correction remains seven files. The package/lockfile and previous review contexts were unchanged; the nearby startup capture-cleanup owner now distinguishes Gateway contention from other failures. That interaction has passed the affected 165-test refresh and whole-candidate review described above.

  • Full native run failed and was stopped: the 679-shard run used verified source 2e720285489 / tree 1139f32e82ed080dd2958569e53daa88ccfc6729. Its TUI PTY lane recorded one failed assertion, 114 passing tests, and one existing skip across nine files. The received output contained the old session footer followed by the clean target footer. #159777 records the append-only-history fixture cause and deterministic counterexample. The already-red run was stopped and its owned Testbox was verified completed; this is not a full-suite pass.

  • Conflict reconciliation: the prior local prerequisite fixes conflict with the now-landed canonical repairs #158739 and #159061. GitHub’s exact-head base update produced verified signed merge 7d9fc7d, with parents 5f929a6 and current main 6786cc7. Contributor ancestry is preserved. The remaining CLI correction and browser diagnostics are committed on that base without the obsolete fixture patches. A fresh read-only merge simulation against native main checkpoint f0b149f was conflict-free; no unsigned local merge or correction publication was used.

  • Before the additional TUI fixture repair, independent P0–P3 autoreview was scoped-clean for the six-file candidate (confidence 0.88; zero findings). Test-audit and deslop preceded review. The complete seven-file repair then passed independent P0–P3 source review (two passes, zero actionable findings; confidence 0.80). The subsequent signed base update introduced a relevant startup-cleanup dependency; its affected proof and whole-candidate review have now passed as recorded above.

  • 415 focused tests across eleven files passed on the refreshed corrected tree in 136.25s command wall, including current model lazy-loading, config snapshot, startup recovery/availability and Commander boundaries. A test-only negative control on exact hosted head 7d9fc7d failed six of sixteen model-run routing cases for the intended reason; all sixteen pass after correction. The required one-worker preAction file passed 90/90 in 59.16s command wall / 52.66s Vitest (91% cold transform, test execution 1%). Complete standalone static validation passed. The native fresh build also passed (7m 38.3s); the native complete static check also passed, but its full-suite run then failed the TUI fixture check and was stopped.

  • Narrow TUI fixture repair: use the existing authenticated current-screen owner to wait for the loaded target-session footer, rather than slicing append-only PTY history. Keep every mode-absence, trace transition, and process-owned delivery assertion, with unchanged wait and test deadlines. The original-order nine-file replays passed 115 tests plus one existing skip both unchanged and with the initial frame-based correction; a passing unchanged replay is not a fix. The final loaded-metadata guard passed the entire changed file: 72/72 tests in 121.86s one-worker command wall / 118.21s Vitest; the existing frame-oracle tests passed 8/8 and targeted static checks passed. No production TUI behavior, case count, process boots, assertions, or deadlines changed.

  • Earlier exact-candidate runtime proof passed: on local candidate 2e720285489, all four concurrent model calls returned successful Gateway transport results across fresh and Doctor-migrated synthetic legacy-state fixtures. Both infer and capability are exercised, including a prompt value of --local. The synthetic HTTP provider received exactly four requests; public sessions.list checks preserved the migrated session ID and timestamp, and both disposable instances cleaned up. Total proof command: 40.24s. Network/PID isolation excludes the operator Gateway and real provider credentials; the expected remote-catalog refresh warning reflects the isolated network.

  • Earlier CI-equivalent UI budget comparison passed: pnpm ui:check-performance:base 6786cc7 on exact candidate 2e720285489 completed in 57.54s using the repository-owned normalized build identity and common toolchain (Node 26.8.2, Vite 8.3.0, Pako 3.0.2). Startup JavaScript was 371,154 B under the unchanged 371,332 B limit; startup/largest CSS delta was zero. This investigated the raw build’s 40-byte advisory overshoot without widening any budget or modifying the running native candidate.

  • Historical runtime proof, not current-base validation: four concurrent model calls passed through real disposable Gateways and a synthetic HTTP provider on exact candidate 01659543fa6, across fresh and migrated legacy-state fixtures. Actual Doctor imported the legacy session, and public sessions.list reads retained its ID and timestamp before and after the concurrent runs.

  • Full native build and static checks passed on local candidate dc1e8117ea0. Five baseline Docs Agent fixture failures were reproduced on unchanged main and repaired without workflow changes or weaker assertions; all 175 related tests passed. The private-QA prerequisite was successfully built in a disposable profile, without touching the operator Gateway.

  • The subsequent shared-host full test run failed, including proxy-produced secret-egress responses and resource cleanup errors. An exact-tree isolated replay passed all 85 representative MCP/secret-egress cases; this is environment-triage evidence, not a full-suite pass.

  • The isolated full test gate then failed at a pre-existing Gateway fixture startup timeout. Its exact 45-file, 476-test original-order shard passed on a clean isolated replay (350.21s versus 1186.84s under full-suite co-scheduling). The specific bottleneck remains unproven; a passing replay is not a fix. Reproduction, suspected resource-pressure cause, and cleanup safeguards are tracked in #158957.

  • A subsequent full run exposed a second pre-existing fixture defect in src/process/exec-spawn.test.ts: it treats a non-running PID as proof that its process group has disappeared. A deterministic isolated waitid(WNOWAIT) / waitpid probe reproduced the mismatch with a real zombie. The original failing process table was not captured. #158997 records the cause and reproduction. The local repair replaces the existing PID-liveness wait with actual group-extinction observation using the same 2,000ms deadline and 25ms interval; PID-reuse and unrelated-process safety assertions remain.

  • On exact repaired tree 098590dbd0a2b8abef61c5af057780bafbc6bf45, the changed process file passed 14/14, and its full process shard passed 976 cases with 64 unchanged platform skips (73 passing files and one unchanged skipped file). The earlier failing full run was stopped and its owned lease was verified terminated; it is not counted as a full-suite pass.

  • The earlier Gateway lifecycle case also passed during the two-project full run in 31.985s. That does not close the unlocalized load-related report. The 1,372-file UI shard passed unchanged in 672.40s, versus 1,214.92s in the prior four-project run; these are separate-run observations, not a claimed fixture fix.

  • An extra remote changed-file check selected its default origin/main baseline and reported growth in an untouched UI file after newer main shrinkage. That file is identical to the pinned PR base. That original attempt remains recorded as failed. The supported local changed-file check, explicitly bound to the real PR base 5d952773, then passed all selected ratchets, formatting, typechecking, dead-export scans, and lint. The native build and full static checks also passed on committed candidate c3dc1ecc834; its complete Testbox suite subsequently ended with delegated exit 255 after 7,198.079s, without a Vitest failing-test summary or successful full-suite receipt. The owned lease is terminal. The exact termination owner is unresolved; bounded provider/source/log investigation is recorded in #159187. No unchanged retry or deadline increase was used.

  • The process-fixture stability bar is complete on the repaired tree: 20/20 standalone file runs (14 cases each) and 3/3 runs of the original 74-file process shard, including its sibling tests (976 passing cases per run, unchanged platform skips). The final stability and cost allocation returned delegated exit 0 and was stopped; enclosing Actions allocation cancellation can be normal lease cleanup. These were one-off proof runs with stop-on-first-failure, not added CI retries or test cases.

  • Earlier full attempt failed and was then interrupted: build and full static checks passed, but the observed Testbox run recorded one Chromium failure in the sandbox-frame readiness helper of ui/src/pages/plugin/plugin-page.session-navigation.browser.test.ts (110/111 files and 1,428/1,429 tests passed in that browser shard). The actual click/navigation assertions were not reached. Later, local native-wrapper and SSH processes received SIGTERM from PID 1 at 03:19:54 UTC; native exit was 143, not a full-suite success. The enclosing allocation eventually showing success is not the delegated test verdict. #159679 tracks the browser failure. An unchanged, exact-tree replay of all 111 browser files passed all 1,429 tests in 103.25s wall / 101.40s Vitest; that passing replay is not a fix. The current investigation adds bounded frame-load/message diagnostics without changing assertions or deadlines and reproduces the browser shard alongside its observed 153-file agents-core neighbor. No additional repair is claimed from diagnostics alone.

  • Prior reviewed candidate eefe61952eb / tree e6cbe37c9ef138b25946ec02654737b1dcc00b47: bounded browser triage did not establish a safe causal repair, so the original one-second readiness deadline, real frame, source checks, and navigation/order assertions remain unchanged. Failure-only diagnostics now retain up to 16 lifecycle/message events and DOM state. Both the complete browser/agents-core pairing and a follow-up that waited for actual neighboring test execution passed; those are not flake-fix claims. The changed UI file passed 7/7 tests in 2.50s one-worker command wall / 1.32s Vitest. The pinned-base static gate passed, test-audit/deslop were completed first, and fresh whole-candidate P0–P3 autoreview is scoped-clean. Its new build passed, but the run was intentionally stopped during static checking before any Testbox allocation after the current-main merge preflight proved four fixture conflicts. This is not a full-gate pass; publication remains pending.

  • Publication for handoff completed: after the contributor explicitly corrected the scope to branch publication rather than native landing preparation, the managed roboclaw-bot identity pushed exact commit 7f5985d by normal fast-forward. The fork branch reported no active rules; contributor ancestry, the reviewed tree, and VACInc credit were preserved. The prior Testbox was terminal and the stale native lock was recovered through its exact-token command before publication. This does not create native successful-gate or signed-publication receipts. Full validation and current-head CI/review remain incomplete; no merge or auto-merge was requested.

ClawSweeper verification

Audited ClawSweeper revision 16 (September 27, 14:56 UTC) in the retained review, explicitly bound to hosted head 7d9fc7d. GitHub reports no inline review threads and no separate formal reviews. The four checklist entries track one substantive parser-boundary defect and its publication/review requirements:

  • Parsed transport (P1): verified and repaired locally for both command aliases, including flag-shaped prompt values. Current-base regressions demonstrate six original failures and 415 focused passing tests after repair. Fresh four-call real-Gateway proof passes on current local candidate 7f5985d; publication is now verified; fresh hosted-head review remains pending.
  • Merge risk (P1): the same mismatch between parsed transport and startup preparation; covered by that repair and proof, not a separate waived finding.
  • Publish and re-review (P2): publication is complete and verified at 7f5985d; fresh corrected-head review remains open.
  • Patch quality / changed-surface validation: the complete current eight-file candidate passed fresh independent P0–P3 source review after the startup-cleanup dependency validation and canonical generated-asset reconciliation. Final hosted-head validation remains open until current-head CI/review complete.

No security finding or additional unanswered question appears in the current review. Earlier proof requests are superseded by its explicit maintainer exemption and no-stored-data-contract assessment; the stronger runtime evidence above remains available. The corrected published head must receive a fresh ClawSweeper review before any separately authorized landing.

Scope limits: no production deployment, real external-provider latency claim, or full published older-version updater test. The earlier read-only runtime fixture logged a post-reply best-effort hidden-session cleanup warning in the unchanged src/agents/internal-session-effects.ts owner; replies and retained-session checks passed, but this PR makes no cleanup/durability claim.

Test audit, cost, and failure triage
  • Test-audit: replaced raw-policy-only assertions with actual Commander/preAction coverage for both aliases, local/default modes, flag-shaped required values, order, and equals syntax. No production test seam, new timer, or process-per-case CI suite. Historical prerequisite repairs, now supplied by canonical main fixes: the three Docs Agent fixture files preserve all Git, cleanup, output, and failure assertions; they supply exact-attempt job responses instead of broadening mocks. The process fixture retains its existing case and safety assertions, replacing the wrong completion predicate without adding a scenario retry, a process boot, or a wait budget. The UI diagnostics retain the original sandbox/navigation test, add no case, timer, process boot, mock, or production seam, and clean up the added load listener in finally.
  • Deslop: policy typing removes literal casts; no remaining actionable cleanup in the diff. The fresh complete-diff pass found no additional actionable cleanup in the bounded diagnostics.
  • Historical costs (current-base preAction cost is recorded above): pnpm test src/cli/program/preaction.test.ts --maxWorkers=1 passed in 25.00s wall, 22.99s Vitest, dominated by cold compilation (test execution below one second). Seven sibling files passed in 39.15s wall. The changed Docs Agent fixture was also measured with pnpm test test/scripts/ci-linux-git.test.ts --maxWorkers=1: 125/125 passed in 65.95s command wall, 64.78s Vitest. Its shared fixture helpers are exercised by this file and the Git-lifecycle suite, not separate executable suites. pnpm test src/process/exec-spawn.test.ts --maxWorkers=1 passed in 17.05s command wall, 15.18s Vitest, in the isolated Testbox; the complete process shard took 124.53s command wall / 88.91s Vitest. A matched clean Linux/Node 24 single-worker comparison of the full Docs Agent file measured 51.32s wall / 50.18s Vitest before (pinned base 5d952773: 120 pass, five expected fixture failures) and 50.24s wall / 49.22s Vitest after (125 pass). These used separate 16-vCPU Testboxes, and the baseline fails early, so no causal speedup is claimed. This existing >30s suite protects branch/provenance, failure propagation, and cleanup through real Git and process ownership; replacing those boundaries with mocks would miss the contract. No cases or process boots were added. The newly changed UI browser file passed via pnpm test ui/src/pages/plugin/plugin-page.session-navigation.browser.test.ts --maxWorkers=1 in 2.50s command wall / 1.32s Vitest, 7/7 tests. Current-head CI timing is pending publication.
  • Triage: the six original regression failures were deterministic. Native full lint also exposed three stale-base max-lines violations; canonical test(gateway): extract chat metadata auth fixtures #158050 and refactor(ui): share sidebar mutation error feedback #158173 fixes were incorporated rather than suppressing checks. One build was interrupted by a Gateway restart. The superseded Testbox run was deliberately stopped while correcting publication topology; it is not reported as a full test pass.
  • Signing/layout: native-supported physical worktree relocation fixed the checkout layout. GitHub’s head-pinned base update is verified signed; the remaining correction is linear and can use native managed GraphQL publication without an unsigned-push override.
  • Hostile-change inspection: no hostile behavior identified in the reviewed eight-file net diff; no dependency, workflow, permission, or credential changes. The generated asset references exactly match the canonical main repair.
Original incident report and earlier evidence (historical)

Summary

High Level TLDR

Fixes a Gateway reply failure when a concurrent openclaw infer model run --gateway starts local state maintenance. Gateway model runs now validate local config without entering Doctor's shared-state migration preflight. Local model runs keep their existing startup path.

Root Cause

Before the fix, the command catalog had no policy for infer model run or its capability alias. Both inherited the default run config guard. ensureConfigReady therefore considered state migration even with --gateway, although this command sends its turn by Gateway RPC. During the reported incident, Gateway logs showed another OpenClaw process owns state-lifecycle across session, ingress, and reply writes; a separate one-shot openclaw-infer process was observed holding the shared-state lifecycle lock. The deployed CLI fallback overlay touched a different file and did not change this startup route.

What Problem This Solves

Fixes: a Gateway-backed one-shot model command can contend with its own Gateway's shared-state lifecycle and cause replies to fail.

User Impact

Concurrent Gateway model runs no longer start local state migration. No schema, configuration, or update migration changes are required.

Why This Change Was Made

The command catalog now chooses validation-only startup for --gateway and retains normal startup for the default local transport and --local. The same policy covers the capability alias.

Initial submission verification

  • Regression: the two gateway startup-policy cases failed on the original code (2 failed | 17 passed) and pass after the fix (19 passed). Command: node scripts/run-vitest.mjs src/cli/command-startup-policy.test.ts --maxWorkers=1 under Node 24.19.0. Whole command: 24.29 seconds after the fix.
  • node scripts/check-changed.mjs passed for core and core tests, including formatting, targeted lint, core and selected test typechecks, repository guards, and import cycles.
  • git diff --check passed. Diff-scoped independent review found no actionable P0–P2 issue.

Initial submission behavior proof

The startup-policy test exercises the command's registered selection for both infer model run --gateway and capability model run --gateway: each returns skipConfigGuard: false, validateConfigOnly: true. Default and explicit local runs return no validateConfigOnly flag. The original code failed those gateway assertions. Source inspection confirms validateConfigOnly prevents ensureConfigReady from running the Doctor migration preflight and uses a non-observing config read. Incident logs show the prior Gateway error and a concurrent CLI lock holder, with private routing details omitted here.

What was not tested

The patch was not deployed to the live Gateway; live restarts are paused. No live chat replay or representative end-to-end latency benchmark was run. An isolated CLI test cannot measure this incident's real concurrent Gateway load, so no deployed latency improvement is claimed.

@clawsweeper

clawsweeper Bot commented Sep 25, 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 3:58 PM ET / 19:58 UTC (Revision 24).

ClawSweeper review

What this changes

The branch gives Gateway model runs client-only config validation for both CLI aliases, adds parsed-flag regression cases, and adjusts TUI and browser test fixtures.

Merge readiness

✅ Ready for maintainer review

Current main still sends Gateway model runs through local startup preflight. This PR has a distinct fix, and its parsed-option policy resolves the prior raw-argument review finding.

Priority: P1
Reviewed head: f056c528db3b32728b2e48404f19a81adf79d223

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch resolves the earlier finding and has useful Gateway-boundary evidence, with exact-head checks still in progress.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The author is a repository MEMBER, so the ordinary external-contributor proof gate does not apply. The captured body reports previous-head runs through disposable Gateways to a synthetic provider, with four successful requests across both aliases and fresh and Doctor-migrated fixtures; no current-head runtime run is claimed, and the earlier catalog blob could not be independently compared here. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository MEMBER, so the ordinary external-contributor proof gate does not apply. The captured body reports previous-head runs through disposable Gateways to a synthetic provider, with four successful requests across both aliases and fresh and Doctor-migrated fixtures; no current-head runtime run is claimed, and the earlier catalog blob could not be independently compared here. No stored-data contract changes.
Evidence reviewed 10 items Current main still lacks the rule: The pinned main catalog has no model-run startup entry, so these commands inherit the default run guard.
Parsed transport selects startup: Both model-run paths use the same policy: only a parsed Gateway selection without local selection receives validation-only startup.
Startup and action consume parsed options: The pre-action hook passes Commander options into startup policy; the registered model action uses its parsed local and Gateway options to choose transport.
Findings None None.
Security None None.

How this fits together

The inference CLI parses a model-run command and checks configuration before dispatching it locally or through Gateway RPC. The Gateway handles the remote agent request and its session writes.

flowchart LR
  A[Model-run flags and prompt] --> B[Commander parsing]
  B --> C{Gateway transport?}
  C -- Yes --> D[Client config validation]
  C -- No --> E[Local startup preparation]
  D --> F[Gateway agent request]
  E --> G[Local model execution]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +19, Tests +71. Total +90 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 21 2 +19
Tests 3 74 3 +71
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 95 5 +90

Review metrics

Metric Value Why it matters
Production and test growth production +19 net, tests +71 net Production growth stays within the existing CLI startup policy; tests cover parsed transport and the two fixture boundaries.

Technical review

Best possible solution:

Keep transport selection aligned between CLI startup and dispatch, with Doctor owning legacy repair and local runs retaining their preflight.

Do we have a high-confidence way to reproduce the issue?

Yes at the source level: current main sends Gateway model runs through the normal local preflight. I did not replay the reported concurrent lock failure.

Is this the best way to solve the issue?

Yes: the patch uses the registered command's parsed transport options in the existing startup policy and retains the local/default path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ad76f83efaa0.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the ordinary external-contributor proof gate does not apply. The captured body reports previous-head runs through disposable Gateways to a synthetic provider, with four successful requests across both aliases and fresh and Doctor-migrated fixtures; no current-head runtime run is claimed, and the earlier catalog blob could not be independently compared here. No stored-data contract changes.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 availability: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The reported local-state lock collision can interrupt Gateway replies during model runs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the ordinary external-contributor proof gate does not apply. The captured body reports previous-head runs through disposable Gateways to a synthetic provider, with four successful requests across both aliases and fresh and Doctor-migrated fixtures; no current-head runtime run is claimed, and the earlier catalog blob could not be independently compared here. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (23 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T14:56:21.570Z sha 7d9fc7d :: blocked before merge. :: [P1] Derive model-run startup from parsed transport options
  • reviewed 2026-09-27T15:25:30.734Z sha 7d9fc7d :: blocked before merge. :: [P1] Derive model-run startup from parsed transport options
  • reviewed 2026-09-27T15:53:02.682Z sha 7d9fc7d :: blocked before merge. :: [P1] Select model-run startup from parsed transport options
  • reviewed 2026-09-27T16:26:52.544Z sha 216a9a4 :: blocked before merge. :: [P1] Select model-run startup from parsed transport options
  • reviewed 2026-09-27T16:44:46.471Z sha 216a9a4 :: blocked before merge. :: [P1] Select model-run startup from parsed transport options
  • reviewed 2026-09-27T17:30:42.030Z sha 216a9a4 :: blocked before merge. :: [P1] Select model-run startup from parsed transport options
  • reviewed 2026-09-27T17:40:53.575Z sha 216a9a4 :: blocked before merge. :: [P1] Select model-run startup from parsed transport options
  • reviewed 2026-09-27T19:35:04.939Z sha 216a9a4 :: blocked before merge. :: [P1] Select model-run startup from parsed transport options

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@roboclaw-bot roboclaw-bot changed the title fix(cli): prevent Gateway replies failing during model runs fix(cli): avoid local startup validation for Gateway model runs Sep 25, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 26, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 26, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 27, 2026
Resolve the generated Workboard manifest conflict using the current main asset output. Preserve the parsed transport startup policy and contributor ancestry.

Co-authored-by: VACInc <[email protected]>
@VACInc

VACInc commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Published f056c528db3b32728b2e48404f19a81adf79d223, preserving contributor ancestry. The parsed-options correction is present for both model-run aliases; the current-main merge resolves only the generated Workboard asset conflict. Fresh independent P0–P3 review is scoped-clean, and 169 startup/config tests pass. The PR body distinguishes current proof, running CI, and historical interrupted full-suite attempts. Please review this exact published head.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 27, 2026
@VACInc
VACInc enabled auto-merge (squash) September 27, 2026 20:03
@VACInc
VACInc merged commit ddc8ebe into openclaw:main Sep 27, 2026
151 checks passed
@VACInc
VACInc deleted the fix/infer-gateway-startup-state-lock branch September 27, 2026 20:07
@VACInc

VACInc commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

VACInc added a commit to VACInc/openclaw that referenced this pull request Sep 27, 2026
Integrate upstream main while retaining PR openclaw#158136 CLI startup policy and TUI history-load synchronization.

Co-authored-by: VACInc <[email protected]>
VACInc added a commit to VACInc/openclaw that referenced this pull request Sep 27, 2026
Restore the upstream PTY test file, preserving PR openclaw#158136 and removing duplicate frame waits.

Co-authored-by: VACInc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…claw#158136)

* fix(cli): keep gateway model runs out of local state migration

* fix(cli): use parsed transport for Gateway model startup

Keep Gateway model invocations on non-observing validation while retaining local/default preparation. Cover flag-shaped prompts through real Commander parsing. Preserve bounded browser diagnostics and correct the TUI fixture to assert the loaded target frame rather than appended prior-session redraws.

Co-authored-by: VACInc <[email protected]>

* fix(workboard): carry canonical generated asset refresh

Keep the generated Control UI manifest consistent with the unchanged canonical asset builder. The regenerated manifest exactly matches main commit 4afb919 after the protocol activity schema update; no capabilities or permissions change.

Co-authored-by: VACInc <[email protected]>

---------

Co-authored-by: VACInc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants