Repository navigation
Description
Summary
The Companion's managed Local AI setup and runtime configuration paths are incompatible with two CLI contracts in the Gateway version now selected by normal setup. This can block fresh installation and managed Local AI startup/restart even on a supported GPU.
Observed with Gateway 2026.9.3 on native Windows 11 x64. Both contracts also exist in the downloaded 2026.9.1 package source; that is source inspection, not a claim of runtime validation on 9.1 or identification of the first affected release.
Normal setup moved from the old Gateway pin to npm latest in #1312 (improve(setup): install latest stable Gateway from npm), followed by #1381 (fix(setup): complete npm latest Gateway landing). The compatibility fix below does not change Gateway version selection.
Discovered while validating #1391. This issue is specifically about CLI compatibility, not GPU eligibility, OOM detection, or Chat recovery UX. It is also distinct from the stale-primary dispatch race in #1293.
What fails
1. Valid-but-unset settings are mistaken for operational failures
The Companion recognizes missing settings by looking for legacy Config path not found: <path> text on stderr. With openclaw config get <path> --json, the observed Gateway returns exit code 1 and a structured JSON error on stdout. It distinguishes a valid-but-unset setting from an unknown configuration path.
Affected paths include models.providers.llamacpp, agents.defaults.model.primary, and agents.defaults.workspace.
Consequences:
- Fresh Local AI setup fails with
Could not safely snapshot the existing Local AI gateway configuration. - Default-workspace initialization can fail with
Could not resolve OpenClaw default workspace path. - The runtime route coordinator cannot reliably verify an absent/withdrawn provider or publish a fresh managed route.
2. Runtime provider batches are passed through a pipe instead of a regular file
The runtime coordinator invokes openclaw config set --batch-file /dev/stdin. The observed Gateway checks that the opened input is a regular file and rejects the pipe:
--batch-file must be a regular file: /dev/stdin. Choose a JSON5 input file and try again.
This blocks publishing the managed Local AI endpoint. These findings demonstrate incompatible Companion assumptions; they do not establish an upstream Gateway bug or a violated documented compatibility guarantee.
Reproduction and observed evidence
- Run managed Local AI setup in a fresh isolated profile with Gateway 2026.9.3 and no authored Local AI provider settings. Before the fix, configuration snapshotting fails.
- After correcting that read path, the next setup attempt reaches default-workspace initialization and fails on the analogous unset-setting response. Correcting that path allows both steps to complete.
- Run the exact production provider batch with
--batch-file /dev/stdin --dry-run: exit 1, regular-file diagnostic above. - Run the identical batch from an owned
mktempregular file with--dry-run: exit 0,Dry run successful: 2 update(s) validated.
Neither batch diagnostic requested a configuration write. The subsequent real setup/runtime proof is separate from those dry-run checks. Raw logs, credentials, model files, screenshots, and the local-only proof commit are not being published with this issue.
Proposed fix
An implementation is already available as the separate top commit on the maintainer's public branch:
19f76060: fix(gateway): support current config CLI missing-value and batch-file formats
- Recognize the bounded, canonical structured unset response for the exact requested path, while retaining supported legacy stderr responses.
- Continue rejecting unknown paths, wrong paths, malformed/oversized output, timeouts, and other operational failures. An arbitrary CLI error must not authorize configuration mutation.
- Use a temporary regular file for runtime batch updates, retain dry-run-before-write, and remove only that file with an EXIT trap. Send the shell script via stdin so
wsl.execannot expand Linux variables in its argv. - Preserve existing ownership checks, rollback, fallback-model behavior, and endpoint publication/withdrawal verification.
Production changes are limited to LocalAiGatewayConfiguration.cs, WindowsNodeBootstrapContextStep.cs, and LocalAiGatewayProviderCoordinator.cs, with corresponding tests. The branch also contains the two separately reviewable busy-GPU setup commits; those are not part of this compatibility commit.
Validation
On product head 19f76060:
- Full repository build passed.
- Shared: 3,989 passed, 34 environmental skips.
- Tray: 2,921 passed, no skips.
- SetupEngine: 1,164 passed, no skips.
- Connection: 787 passed, 4 environmental skips.
- Real Gateway 2026.9.3 -> Windows node -> MXC
system.run: 17 passed, no skips, without-AllowSkip. This verifies the real Gateway/node path, not every Local AI lifecycle branch. - Focused tests cover structured and legacy unset responses, rejected error cases, rollback, cold-start/restart/teardown sequencing, and generated batch-script/stdio shape. Fake-runner tests are not represented as real Gateway execution.
ARM64/RTX Spark validation remains outstanding. Existing exact-version selectors and legacy Gateway error-format support should remain intact.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Sep 10, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 10, 2026, 5:37 PM ET / 21:37 UTC.
Summary
Both reported incompatibilities remain on current main and are corroborated by Gateway 2026.9.3 source. The supplied compatibility commit provides a focused starting point; the related GPU and restart-routing work does not resolve this issue.
Reproducibility: yes. from source: Gateway 2026.9.3's structured unset response reaches the Companion's failure branches, and its regular-file check rejects the runtime pipe. The reporter describes matching native failures; this review did not execute them.
Root-cause cluster
Relationship:
canonicalCanonical: #1398
Summary: This issue isolates CLI compatibility from GPU admission, stale dispatch, and recovery workflow changes.
Members:
adjacent_distinct: Local AI: allow setup on busy GPUs and handle model-load OOM at use time #1391 - Addresses busy-GPU installation policy and load-time recovery UX rather than CLI formats.adjacent_distinct: fix(local-ai): avoid stale OpenAI primary after provider hot reload #1293 - Addresses stale primary-model dispatch after reload rather than failed config reads or batch input.adjacent_distinct: fix(local-ai): add non-destructive recovery #1384 - The open non-destructive recovery implementation does not claim these CLI compatibility repairs.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
A bounded, source-proven repair has clear owners and tests, no required product-policy change, and no open PR claiming it; reuse the supplied compatibility work where suitable.
Review details
Best possible solution:
Adapt the existing configuration readers and batch writer without weakening ownership or rollback checks, so normal setup and an in-product Retry recover without manual configuration edits.
Do we have a high-confidence way to reproduce the issue?
Yes, from source: Gateway 2026.9.3's structured unset response reaches the Companion's failure branches, and its regular-file check rejects the runtime pipe. The reporter describes matching native failures; this review did not execute them.
Is this the best way to solve the issue?
Yes, adapting these existing consumers is the narrowest repair, and setup already demonstrates compatible regular-file batching. The supplied commit should be reviewed independently from the busy-GPU changes.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 621f4100f8b4.
Label changes
Label changes:
P0: Normal fresh Local AI setup can stop on supported hardware with no demonstrated in-product path past the incompatible CLI responses.impact:auth-provider: The affected coordinator cannot reliably publish or verify the managed model provider and primary route.impact:ux-release-blocker: The failure blocks installation or first useful Local AI startup and currently requires a code-level compatibility repair.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P0: Normal fresh Local AI setup can stop on supported hardware with no demonstrated in-product path past the incompatible CLI responses.impact:ux-release-blocker: The failure blocks installation or first useful Local AI startup and currently requires a code-level compatibility repair.impact:auth-provider: The affected coordinator cannot reliably publish or verify the managed model provider and primary route.Evidence reviewed
Acceptance criteria:
What I checked:
src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs:244, 621f4100f8b4)src/OpenClaw.SetupEngine/LocalAiGatewayConfiguration.cs:348, 621f4100f8b4)src/OpenClaw.SetupEngine/WindowsNodeBootstrapContextStep.cs:410, 621f4100f8b4)src/cli/config-cli.ts:142, 1391f7cd2d40)src/cli/config-set-input.ts:72, 1391f7cd2d40)src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs, 19f7606001b0)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.