#4109: fix(cli): bypass config guard for tui --url
docs
cli
Cluster:
Context Management Fixes
Fixes #3107.
Summary:
- Treat `moltbot tui --url ...` as client-only mode.
- Bypass config validation in the CLI preAction hook so a remote TUI client doesn’t require local plugins/config.
Testing:
- pnpm lint
- pnpm build
- pnpm test
AI-assisted: yes (Codex CLI).
Docker: not available locally for `docker run ...` smoke checks.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the CLI preAction hook so `moltbot tui --url …` is treated as a client-only mode and skips `ensureConfigReady`, allowing remote TUI usage without requiring local config/plugins. It also documents the behavior in `docs/cli/tui.md` and adds a focused Vitest to ensure the config guard is bypassed when `--url` is provided and still enforced otherwise.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge; changes are small and covered by a targeted unit test.
- The change is localized to the CLI preAction hook and gated on `tui` + `--url`, with a new test asserting both bypass and non-bypass paths. Main remaining risk is edge-case argv ordering/flag forms not covered by tests, and the new test’s reliance on global `process.argv` state.
- src/cli/program/preaction.ts; src/cli/program/preaction.tui-remote-bypass.test.ts
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<details><summary><h4>Context used (3)</h4></summary>
- Context from `dashboard` - docs/cli/agents.md ([source](https://app.greptile.com/review/custom-context?memory=057a11aa-5c5f-48bb-8d53-91b27b0fe3a2))
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
</details>
<!-- /greptile_comment -->
Most Similar PRs
#11109: fix(tui): prefer config contextTokens over persisted session value
by marezgui · 2026-02-07
77.2%
#9220: Fix: TUI drops API responses silently when runID already finalized
by vishaltandale00 · 2026-02-05
76.2%
#6059: fix #6044
by vivganes · 2026-02-01
76.1%
#3783: Fix/3038 cli name moltbot
by Shuimo03 · 2026-01-29
75.6%
#7085: test: skip flaky workspace-paths & safe-bins tests on non-Linux/CI ...
by ThinkIbrokeIt · 2026-02-02
75.4%
#9628: fix: resolve tsconfig rootDir errors by separating UI config (AI-as...
by KGBos · 2026-02-05
75.3%
#13838: UI: fix config panel CI failures and modularize rendering
by fresed05 · 2026-02-11
75.0%
#5391: fix(commands): prevent webchat/tui from inheriting messaging channe...
by Glucksberg · 2026-01-31
74.9%
#11169: fix(security): remove bundled soul-evil hook that enables silent ag...
by liuxiaopai-ai · 2026-02-07
74.5%
#12987: fix(cli): exit process after successful command completion
by omair445 · 2026-02-10
74.5%