Skip to content

fix(tui): resolve checkout from any folder + back-compat [tui] extra#5

Merged
akozak-gd merged 2 commits into
mainfrom
fix/tui-install-resolve-checkout-from-any-folder
Jun 30, 2026
Merged

fix(tui): resolve checkout from any folder + back-compat [tui] extra#5
akozak-gd merged 2 commits into
mainfrom
fix/tui-install-resolve-checkout-from-any-folder

Conversation

@akozak-gd

@akozak-gd akozak-gd commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Two issues with the installed specflow CLI / TUI:

  1. uv tool install --editable "./mcp_server[tui]" warned does not have an extra named 'tui'. textual had been moved to a base dependency, which deleted the tui extra entirely, while older install commands still referenced [tui].
  2. specflow tui only launched from inside the cloned repo. Run from any other folder it flashed the app open and exited with no visible message (the in-app gate could only notify() then exit(), which tears the screen down before the toast paints).

Fix

[tui] extratextual is a base dependency, so a fresh uv tool install --editable ./mcp_server (as documented in QUICKSTART) always has a working TUI. The now-unused tui optional-dependency extra is removed; the only references left were the extra itself and a stale test comment.

Resolve the checkout from any folder — the documented install is uv tool install --editable ./mcp_server, so the binary runs the code straight from the clone. Added installed_repo_root() (derives the checkout from the module's own __file__) and resolve_repo_root() (cwd walk-up, else the install's own checkout), factored on a shared _find_sentinel_root helper. run_tui and specflow init now use resolve_repo_root, so they work from any directory with no extra setup — running from inside a different checkout still wins.

Graceful failure — when no checkout can be resolved (non-editable / PyPI install with no clone), the TUI prints an actionable, audience-aware message instead of silently flashing open:

  • self-hosting → run from the clone, pass --root-path, or install editable;
  • remote backend → the TUI doesn't apply, use the MCP tools / CLI.

Notes / scope

  • Making the stack run with no clone at all is intentionally out of scope: the backend image is built locally from ./backend/Dockerfile (no published image) and compose bind-mounts ./scripts, ./workspaces, ./agent_logs — the clone is the runtime, not just config. This change only fixes where the TUI finds the checkout.
  • Zero-setup "works from any folder" is inherent to the editable install. A PyPI install resolves the checkout via cwd / --root-path only, and self-host self-heals because specflow init reinstalls the tool editable.

Tests

  • test_local_env.pyinstalled_repo_root / resolve_repo_root (cwd-wins, fallback, none-when-neither).
  • test_tui_app.py — launches from a resolved checkout; refuses visibly when none resolves.
  • test_cli_init.py — updated no-checkout case.
  • Full mcp_server suite passing.

Verification

  • uv tool install --reinstall --editable . → no warning, textual installed, TUI tests pass.
  • cd /tmp && specflow tui → resolves the clone and proceeds (no "must be run from checkout" error).
  • cd ~ && specflow init → runs against the same clone.

Comment thread mcp_server/pyproject.toml Outdated
@akozak-gd
akozak-gd requested a review from awrobel-gd June 30, 2026 13:47
@akozak-gd
akozak-gd merged commit 5cd52fb into main Jun 30, 2026
3 checks passed
@awrobel-gd awrobel-gd added the bug Something isn't working label Jun 30, 2026
@mkonopelski-gd
mkonopelski-gd deleted the fix/tui-install-resolve-checkout-from-any-folder branch July 1, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants