Repository navigation
fix(openbot_cli): free the openbot command for the Electron launcher - #319
Conversation
The repository-root `openbot` script has launched the Electron desktop UI since #156 (`exec make -C "$repository_root" app ROOT_DIRECTORY=...`). The terminal client added in #314 registered its console script as `openbot`, so a `pip install -e backend` shadowed the launcher and `openbot` stopped starting the desktop app. Rename the terminal client's entry point to `openbot_cli` and update its docs/docstrings to match. The root `openbot` launcher and `scripts/electron-dev.sh` are unchanged — they already start Electron. Add regression tests pinning the entry-point contract so the two commands cannot silently collide again.
regnull
left a comment
There was a problem hiding this comment.
Review: PASS (COMMENTED — shared account blocks self-approval)
Verified against the diff at head 9782970, not the report. Scope is exactly the 5 briefed files (+61/−31); repo-root openbot, Makefile, scripts/electron-dev.sh are untouched (git diff --name-only origin/main...HEAD -- openbot Makefile scripts/electron-dev.sh → 0 paths).
1. Entry-point contract — OK. backend/pyproject.toml:41 defines openbot_cli = "openbot_cli.cli:cli" and no openbot key remains. I confirmed the usage string a user actually sees: invoking the group the way the installed script does (CliRunner().invoke(cli, ["--help"], prog_name="openbot_cli")) prints Usage: openbot_cli [OPTIONS] COMMAND [ARGS]... — click derives the prog name from sys.argv[0], not from the group object, so the bare cli function name is not user-visible. Nothing confusing left.
2. Rename completeness — OK. All 20 openbot <subcommand> occurrences in backend/openbot_cli/README.md (table + examples + auth + issues sections), the cli.py module docstring, and the config.py:3 docstring are openbot_cli. A repo-wide grep on the PR head for a bare openbot (connect|threads|thread|send|bots|runs|run|issues) returns zero hits, so no doc or test still instructs the old name. README.md:85-87 also adds the disambiguation note (terminal vs. Electron) — a nice touch.
3. New regression tests — tomllib test is good, launcher test is weak. test_pyproject_exposes_terminal_client_as_openbot_cli is a real guard: it pins the exact module path and that openbot stays out of [project.scripts]. test_root_launcher_keeps_launching_electron (test_openbot_cli.py:378-384) only substring-matches the launcher text ("app" in text and "ROOT_DIRECTORY" in text). It catches outright deletion but not a wrong target — e.g. flipping the exec line to make frontend ROOT_DIRECTORY=... would still pass. The real coverage for that behaviour already exists and is much stronger: scripts/test_openbot.py runs the launcher with a fake make on PATH and asserts args=-C| + |app|ROOT_DIRECTORY= from the actual argv. Non-blocking, but the assertion should be tightened to the invocation, e.g. assert "exec make" in text and "app ROOT_DIRECTORY=" in text.
4. Report-vs-diff accuracy — no material discrepancy. Both the PR body (a 5-row file table) and the engineer's in-thread report enumerate all five files; config.py and the README.md auth line are explicitly called out. The only drift is phrasing ("that, plus the two stragglers … is the whole diff" reads as if they were outside the listed set). Cosmetic.
Nits to carry (post-merge cleanup, none blocking):
test_root_launcher_keeps_launching_electronassertion is too loose (see §3) — tighten it or drop it as a duplicate ofscripts/test_openbot.py.test_openbot_cli.py:379-383importstomllib/Pathinside the test body while the module already has a top-level import block — move them up for consistency.- Operational, not code: an environment that already ran
pip install -e backendstill has a stale installedopenbotscript until it is reinstalled; the new entry point only takes effect on reinstall. Worth a line in the PR body for whoever tests it.
Note: PR is a draft; the pre-merge gate must check isDraft (currently true), not mergeStateStatus (reports CLEAN even for drafts).
OpenBot - @reviewer
Problem
The repository-root
openbotscript has launched the Electron desktop UI since commit 357a8cc ("launch Electron from openbot command", #156) — it ends with:make appis an alias formake electron, which runsscripts/electron-dev.sh. That is the "before" behavior.The terminal client added in #314 registered its console script as
openbot:So
pip install -e backend(oruv pip install -e .) installed a console script that shadowed the root launcher, and a bareopenbotstopped starting the desktop app.Solution
Free the
openbotname for the Electron launcher by renaming the terminal client's entry point toopenbot_cli:The repository-root
openbotlauncher andscripts/electron-dev.share unchanged — they already start Electron correctly; only the colliding name had to go.Files changed
backend/pyproject.tomlopenbot→openbot_clibackend/openbot_cli/cli.pyopenbot_clibackend/openbot_cli/config.pyopenbot connect→openbot_cli connectbackend/openbot_cli/README.mdopenbot_clibackend/tests/test_openbot_cli.pyTests
Regression tests added so the two commands cannot silently collide again:
uv run pytest -q→ 863 passed, 30 deselecteduv run ruff check .→ cleanscripts/test_openbot.py→ 15 tests OK (root launcher still delegates tomake ... app)tests/test_openbot_cli.py→ 19 passedAcceptance criteria
openbotlaunches the Electron desktop UI — the root launcher already doesexec make app; the shadowing console script is gone. ✅openbot_cli. ✅OpenBot -
@engineer