Repository navigation
fix: target Control UI repairs at the detected checkout - #137354
Conversation
Bind Doctor and asset-owner manual build/development instructions to the already-discovered checkout with pnpm --dir. Reuse POSIX and PowerShell literal quoting without changing automatic builds or packaged recovery. When the Gateway cannot resolve its assets, recommend Doctor/reinstall instead of a source build with no known working directory. Closes #137345. Validated with 107 focused tests, the complete changed-file gate, real shell command execution, and independent scoped review. The built pre-fix CLI reproduces the wrong-directory execution with private state.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 10:46 AM ET / 14:46 UTC. ClawSweeper reviewWhat this changesThis PR makes manual Control UI build and development guidance run in the detected OpenClaw source checkout, with shared POSIX and PowerShell-safe quoting. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still emits unqualified Control UI build commands, while this focused branch binds both Doctor and asset-owner guidance to the detected checkout without changing automatic builds or packaged-install recovery; no blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherDoctor detects missing or stale Control UI assets and emits a repair command for the checkout that owns those assets. Gateway startup and the asset builder consume the same assets and must direct operators to a repair path that can identify the correct installation. flowchart LR
A[Doctor asset check] --> B[Detected source checkout]
B --> C[Shared command formatter]
C --> D[Operator shell]
D --> E[Control UI asset build]
E --> F[Gateway asset startup]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +64, Docs +12. Total +91 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one root-bound command renderer for Doctor and asset-owner messages, preserve automatic root-bound execution, and keep unresolved Gateway cases on the safe Doctor-or-reinstall recovery path. Do we have a high-confidence way to reproduce the issue? Yes. The linked report records a built-CLI foreign-directory reproduction, and current main still contains the same unqualified Doctor, asset-owner, and unresolved-Gateway guidance; the added regression test directly models the wrong-directory execution. Is this the best way to solve the issue? Yes. Reusing the already-discovered root in one shell-aware formatter repairs the producer of the misleading command, while direct automatic builds and packaged-install reinstall guidance retain their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f9a43c083c7d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer disposition for the current ClawSweeper review: the requested single root-bound renderer is already the implementation being landed. I accept the +15 production-line increase for carrying the detected checkout into executable guidance while sharing the existing shell-literal contract. There is no second automatic-build or command-rendering flow. The data-model compatibility prompt is not applicable: the flagged Doctor/Gateway changes are message projection and an import, not schemas, migrations, backfills, storage access, or persisted-state semantics. Automatic repair execution and Gateway state transitions are unchanged. No migration was performed or is required. Both dispositions are recorded in the PR body. Exact-head CI33768095321 passed on The native main baseline was inspected: the 20 reviewed source/context files and additional runtime/lint/normalization contracts are unchanged from the tested base. The only inspected package drift removes an unrelated root Slack development dependency. Commands, proof boundaries, setup failures and named follow-ups are retained in the PR body. Native Windows execution is not claimed; PowerShell syntax was exercised on macOS. No rendered layout change is present. |
|
Merged via squash.
|
* refs/remotes/origin/main: fix(plugins): reject unverifiable pinned npm installs (#136725) improve(ui): lift sidebar section headers on hover and mark online owners (#136985) test(cron): reuse isolated run suite hooks (#137341) test(channels): reuse shared indexed call guards (#137350) fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317) fix(qa-channel): preserve conversation kind for implicit actions (#137343) fix: target the source checkout in Control UI repair commands (#137354) chore: reduce CI job count and database test overhead (#137352) fix(ios): preserve chat live edge across keyboard transitions (#136660) refactor(control-ui): consolidate mention inbox requests (#137375) fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146) fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546) test(queue): reuse shared deferred fixtures (#137338) fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
…aw#137354) Bind Doctor and asset-owner manual build/development instructions to the already-discovered checkout with pnpm --dir. Reuse POSIX and PowerShell literal quoting without changing automatic builds or packaged recovery. When the Gateway cannot resolve its assets, recommend Doctor/reinstall instead of a source build with no known working directory. Closes openclaw#137345. Validated with 107 focused tests, the complete changed-file gate, real shell command execution, and independent scoped review. The built pre-fix CLI reproduces the wrong-directory execution with private state.
Closes #137345.
Additional instructions
Maintainers can edit this repository-owned branch.
What Problem This Solves
Fixes an issue where users following Doctor's Control UI repair instructions could run an unrelated project's build script when their terminal was outside the detected OpenClaw checkout. Doctor knew which checkout needed repair, but its manual
pnpm ui:buildinstruction discarded that information. The asset owner's build/development log had the same omission, and the Gateway's unresolved-root fallback suggested a source build without identifying a checkout.Why This Change Was Made
Manual source commands now carry the already-discovered root through one shared
pnpm --dir <checkout>formatter. The change reuses POSIX quoting and factors the existing PowerShell literal handling into a shared primitive. It does not change the automatic builder, which already runs the absolute UI script with the correct working directory.Packaged installations without UI sources still receive reinstall guidance. When the Gateway cannot resolve its assets after a build, it points to Doctor/reinstallation rather than an unqualified source build. No configuration, dependency, protocol, storage, or service-lifecycle behavior changes.
User Impact
Operators can copy the complete displayed build command from another directory without accidentally running that directory's project script. Source-root paths containing spaces and apostrophes remain usable. Commands use POSIX quoting on Unix and PowerShell quoting on Windows; existing installation-target handoffs retain their behavior.
Evidence
Reviewed and built head:
6359b13f04f1a3c19290217ccf66169569f86718.Actual built CLI before/after: with fresh private HOME, config, state, workspace, logs, and a foreign working directory outside any pnpm workspace, the unchanged build returned a healthy result, then the expected missing-assets warning. Its displayed command exited zero but wrote the unrelated project's marker and left OpenClaw's index missing. Restoring the original index restored the healthy control. On the final build, the displayed root-bound command rebuilt OpenClaw's actual UI assets in 7.1 seconds, left the unrelated project untouched, and the next diagnostic returned
ok:truewith no findings. Config bytes stayed unchanged, no state database was created, and every process group drained.Regression and sibling proof: four regressions were observed before production edits. The final seven suites pass 107/107, zero failures or skips, covering missing/stale guidance, automatic source builds, packaged recovery, Gateway root lifecycle, and the existing triage/update-triage quoting callers. Fourteen additional real-shell command executions passed across Bash, Zsh, Fish, and PowerShell on macOS, including straight and typographic apostrophes in source paths. PowerShell execution exercised Windows presentation syntax; this is not a native-Windows OS proof claim.
The following source-relative commands were run through an isolated environment wrapper with Node 24.15.0 and pnpm 12.1.0. JSON-report output destinations are omitted here.
The complete changed-file gate passed. The final artifact build passed with no ineffective-dynamic-import warning; existing dependency eval/plugin-timing diagnostics were retained. Fresh independent Codex autoreview of the final nine-file patch was scoped-clean at P0, with no findings.
Validation notes: the new worktree initially lacked local tool binaries, so its locked dependencies were installed without manifest/version changes. That exposed a separate Vitest 4.1.11 cache-invalidation ordering defect after the installed-lock identity changed. The failure and cache evidence were preserved, Vitest's own cache-clear operation was limited to task-owned caches, and the original test order then passed. The upstream cache lifecycle is a named follow-up, not a fix claimed by this PR. Two CLI fixture setup attempts also exposed inherited pnpm workspace discovery; the successful proofs use non-repository temporary directories. No cache policy, timeout, or dependency patch was changed to make this repair pass.
Production: +24/-9 (net +15). Tests: +68/-4 (net +64). Docs: +12. Production growth provides shared source-root-bound commands for two existing owners and reuses the existing shell-literal contract instead of adding another escaping implementation.
This is CLI/log guidance, not a rendered UI layout change. Exact-head CI and native review-artifact validation passed. Native preparation and merge follow.
Maintainer review disposition
The latest ClawSweeper review found no patch or security defect and identified this as the best owner-boundary fix. Its two remaining prompts are addressed as follows:
Exact-head CI run 33768095321 completed successfully on
6359b13f04f1a3c19290217ccf66169569f86718, attempt 1, with no unsuccessful or pending jobs. These are evidence/disposition updates only; the reviewed source head has not changed.