Repository navigation
fix: restore Fish completion after global CLI options - #115222
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 11:51 AM ET / 15:51 UTC. ClawSweeper reviewWhat this changesThe branch replaces Fish’s generic root-subcommand check with OpenClaw’s command-path-aware matcher so value-taking global options do not consume root commands, and it stabilizes three affected Control UI tests. Merge readinessThis is a focused repair for a reproducible Fish completion regression, with substantial real-shell proof and no discrete patch defect established from the provided current-head evidence. Keep it open for explicit maintainer review: the PR carries the protected Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s CLI generates shell-specific completion scripts from its Commander command tree. Fish evaluates the generated predicates while users type global options and commands, then returns matching commands, aliases, or option suggestions; the related UI changes only make shared-browser test setup deterministic. flowchart LR
A[User types OpenClaw command] --> B[Fish completion script]
B --> C[Command-path matcher]
C --> D[Global option values skipped]
D --> E[Commander command tree]
E --> F[Root or nested suggestions]
G[Control UI test setup] --> H[Restored history and ready UI state]
Decision needed
Why: The protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +71. Total +72 across 5 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Refresh the branch against current Do we have a high-confidence way to reproduce the issue? Yes. The PR documents twelve actual Linux Fish failures on a clean main revision and shows the same source and packaged CLI paths passing after the change. Is this the best way to solve the issue? Yes, provisionally. Reusing the existing command-path-aware Fish matcher removes the incorrect root-only special case and derives option semantics from the canonical Commander tree rather than adding a parallel parser. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b403cb5d50ac. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
d981333 to
608fc11
Compare
|
Merged via squash.
|
…-20260728 * origin/main: fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (#115027) [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (#115064) refactor(workboard): tidy Control UI card execution helpers (#115195) perf(agents): amortize history-limit eviction with hysteresis (#115273) (#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (#115232) fix: restore Fish completion after global CLI options (#115222) refactor(agents): collapse the client-tool catalog branch (#115212)
* origin/main: (199 commits) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (openclaw#115264) test(migrations): avoid mtime precision in checkpoint fixture (openclaw#115269) test(signal): verify archive limits without malformed tar (openclaw#115270) refactor(sessions): isolate legacy transcript fixtures (openclaw#115231) fix(discord): clear pending launch watchdog (openclaw#115100) fix(agents): stop quadratic subagent prompt rendering (openclaw#115263) fix(memory-core): recover dreaming cron reconciliation (openclaw#115174) fix(qa-lab): filter incompatible channel scenarios (openclaw#115087) fix(android): respect locale in compact labels test(i18n): prove iOS discovery catalog ownership ...
* origin/main: (62 commits) feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (openclaw#115280) fix(qa): restore full-stack scenarios and truthful suite exits (openclaw#115290) feat(memory): backfill past sessions from Control UI (openclaw#115266) docs: link macOS onboarding pages to app download (openclaw#111361) feat(skills): shared authoring standards make learned skills routable (openclaw#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (openclaw#115248) refactor(ui): adopt @lit/task across remaining page surfaces (openclaw#115274) fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (openclaw#115027) [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (openclaw#115064) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) ...
* fix(cli): restore Fish completions after root options * test(ui): restore shared history after agent tool clicks * test(ui): wait for terminal availability before toggling * test(ui): wait for Settings takeover before asserting sidebar
What Problem This Solves
Fish completion silently loses root commands, aliases, and global options after a normal space-separated root option. For example,
openclaw --profile work goffers filesystem entries but notgateway, while the equivalentopenclaw --profile=work gworks. The same defect affects the documented--log-leveland--containeroptions, repeated root options, root aliases, and global-option suggestions.Why This Change Was Made
Fish's built-in
__fish_use_subcommandtreats the value of--profile workas a subcommand because it cannot know OpenClaw's Commander value-taking options. Reuse OpenClaw's existing command-path-aware Fish matcher for root and nested completion alike. Guard the empty root path before indexing Fish arrays, and derive root value-taking flags directly from the canonical Commander command tree.This removes the special root completion branch instead of adding a profile-specific exception, new configuration, additional dependency, or parallel completion parser. Production code grows by one net line.
User Impact
Fish users can complete documented root commands, aliases, and root options after separate or inline profiles, log levels, containers, repeated global options, and command-shaped option values. Existing nested completion, positional skill queries, Bash, Zsh, real PowerShell, completion installation, and machine-readable CLI output remain unchanged.
Evidence
fe9893d41c2bedd71fd4eb0bb9f0c9c9f79b1be7.pnpm check:changed -- src/cli/completion-cli.ts src/cli/completion-cli.test.ts ui/src/pages/agents/panels-tools-skills.browser.test.ts: formatting, production and test typechecks, lint, dependency pins, plugin boundary/API, schema/database, import-cycle, webhook, and pairing/security guards all pass.pnpm build, CLI bootstrap, 146 public SDK exports, and Control UI build pass.openclaw.mjs.autoreview --mode uncommitted: clean; no accepted/actionable findings.Inspectable Real Fish Proof
Current main, before the fix:
Actual final source CLI:
Actual built, packaged CLI:
Upstream CI Isolation Repair
The first exact-head hosted run exposed an existing non-isolated Control UI failure in
checks-node-compact-large-4: the agent tools chip test clicks#agent-tool-readand leaks that hash into subsequent Settings routing tests. The production routing code correctly preserves URL hashes, so weakening its assertions would hide the underlying shared-browser-state bug.This PR repairs the mutation in its actual test owner: capture both
window.history.stateand the complete pathname/search/hash before each agent tools test, then restore both inafterEach. This is test-only isolation; no Control UI product runtime changes.Additional Hosted Chromium E2E Repair
The final exact-head hosted Control UI E2E job uncovered an independent existing test startup race:
ui/src/e2e/terminal-repaint.e2e.test.ts:79timed out waiting forterminal.openafter issuing the realControl+Backquoteshortcut.connectbefore its response has finished advertising and lazily upgrading the terminal panel. Sending the shortcut in that interval is correctly ignored by the production availability guard.openclaw-terminal-panel.available === truebefore issuing the unchanged real keyboard shortcut. Keep every repaint digest, hide/show cycle, input assertion, and single-session assertion unchanged; do not alter production terminal behavior or weaken any check.Actual Chromium proof against fresh main
The exact E2E test file on freshly pulled canonical
mainand the pull-request base has the same Git blob,478881a3345c55ee0b5a699498353207fcc92734. Because the preferred prepared remote browser runner was queued and the direct AWS broker was not configured, the trusted-source fallback used the existing installed local Playwright Chromium and dependencies without installing or reconciling worktree dependencies. The temporary proof patch was removed and canonicalmainwas verified clean afterward.Fresh isolated independent review:
autoreview clean: no accepted/actionable findings reported(correctness confidence 0.96). The additional E2E fix passesoxfmt --check,git diff --check, three repeated actual Chromium runs, and every focused terminal E2E sibling. Earlier sections document the original 398 passing tests, full changed-file gate, production build, and 52 real shell scenarios.Fresh-Main Rebase and Merge Proof
While exact-head CI was running,
mainindependently landed35f035806baf5bdec0c4d3e366d69679fb83c938(fix(ui): avoid duplicate session refreshes during startup) and introduced a simplerafterEachinto the same agent-tools test. The branch was rebased onto that latest main and the single overlap was resolved by preserving the more complete before/after history snapshot, includinghistory.state, the complete URL, and any preexisting fragment. Upstream startup and session changes are retained unchanged.Fresh-baseline proof with the exact resolved UI implementations:
All four final changed files pass the canonical formatter and
git diff --check. Both the rebased PR checkout and refreshed canonicalmainare clean.Additional Chromium Settings-Takeover Repair
A subsequent full protected browser run confirmed the terminal repaint repair and revealed a second existing race in
ui/src/e2e/sidebar-customization.e2e.test.ts:346: after navigation to/settings/general, the Settings sidebar can render before the previous application sidebar has finished yielding. The hosted run passed 368 browser tests and exposed this singleexpected true to be falsefailure.The two-line, test-only fix waits for the actual prior sidebar to become hidden before continuing. It preserves the real menu clicks, URL assertion, visible Settings surface, and original app-sidebar assertion; it changes no production code and does not replace user interaction with mocks or increase test timeouts.
Actual Chromium validation, with both independently observed full-suite failures in one process:
Fresh independent isolated review:
autoreview clean: no accepted/actionable findings reported(correctness confidence 0.98). The exact additional file passes the canonical formatter and staged whitespace validation; canonical main was restored clean after Chromium proof.Maintainer Resolution of ClawSweeper Merge Risks
c0cb550208a6e5264ed894528ccdbac940c5d12d. The complete Chromium lane now passes the formerly failing terminal and Settings/sidebar user flows.