feat(tui): add Bubble Tea interface with provider setup - #941
Open
kusonooyasumi wants to merge 54 commits into
Open
feat(tui): add Bubble Tea interface with provider setup#941kusonooyasumi wants to merge 54 commits into
kusonooyasumi wants to merge 54 commits into
Conversation
kusonooyasumi
marked this pull request as ready for review
July 30, 2026 21:47
Contributor
Greptile SummaryAdds a platform-packaged Bubble Tea interface and its Python protocol-v3 backend.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code-triggered failures identified. Provider mutations invalidate cached settings, setup validation and model preflight reroute credentials before scan startup, and the runner refreshes model configuration again before execution; the packaging and protocol paths also include platform and handshake validation. Important Files Changed
Reviews (1): Last reviewed commit: "feat(tui): add fresh-run setup commands" | Re-trigger Greptile |
Resolves conflicts with the lazy-import startup (usestrix#920) and mounted local targets (usestrix#958): drops the redundant --mount plumbing (local directories are now always mounted), keeps main.py model imports lazy, and routes the TUI /mount command through mountable-dir validation.
The Go/Bubble Tea TUI is now the only interactive interface. Deletes the Textual app, its renderers and stylesheet, drops the textual dependency, and removes the PR-added ci.yml workflow. The shared Textual-free TuiLiveView projection stays for the Go backend and viewer.
Keep only the Go sidecar wheel build, sidecar presence verification, and wheel artifact upload in the release workflow.
First-principles layout: the Go/Bubble Tea source (cmd/, internal/, go.mod) moves from top-level tui-go/ into strix/interface/tui/, the sidecar launcher becomes strix.interface.tui.runtime (was go_tui.py), and tui_backend becomes strix.interface.tui.backend. Go rendering is split out of the 1.9k-line render.go into an internal/render package with one file per tool renderer (terminal, file edit, report, dependency, notes, todo, agents graph, proxy, simple tools, registry), mirroring the old Python renderers layout. Wheel builds exclude the Go source; the compiled sidecar still ships as strix/bin/strix-tui.
0xallam
force-pushed
the
feat/go-tui-provider-setup
branch
from
August 2, 2026 17:31
ad52570 to
03c6ab5
Compare
respond_to_user, wait_for_agents, list_reports, and get_report had dedicated renderers in the old Textual UI but fell through to the generic dump in Go (the agent-graph switch matched the nonexistent wait_for_message tool). Also drops the unused width parameter from render.Chat/render.Tool and adds table-driven coverage for every dispatch case.
Target resolution, run preparation, model preflight, and start telemetry move from strix/interface/main.py into strix/interface/scan_setup.py, so the TUI runtime no longer imports private helpers from the CLI entry point (and the main -> interactive -> runtime -> main import cycle is gone). clone_repository now raises ValueError instead of printing a panel and calling sys.exit, so SystemExit is no longer used as control flow in the setup path; main() renders the error panel itself.
…unts state setup.select_provider, setup.save_api_key, and setup.add_custom_provider now all return _provider_record() (the same shape as providers.list), and the Go model folds them in through one applyProviderRecord helper. The controller's parallel mounts list is gone: /mount just adds the directory as an ordinary local target, matching the CLI's semantics, so snapshots no longer carry mounts/mount_count.
parse_arguments now establishes the full startup-state schema (needs_setup, setup_invalid_provider/guidance, targets_info, local_sources, diff_scope, run_name) in one place, so the TUI controller and runtime read attributes directly instead of probing with getattr defaults. main()'s interleaved 'if not setup_mode' blocks are folded into _detect_provider_setup_need() and _bootstrap_scan(), leaving a single linear flow.
Parses the Go protocol declaration shipped in the tree and asserts the version and capability list match the Python backend's constants, so the duplicated wire declarations cannot drift silently.
model.go (3.6k lines) is now model.go (types/Model/Update loop entry), update.go (key/mouse/modal input), wire.go (protocol envelope and collection handling), picker.go, setup.go (setup wizard commands and views), view.go (main/chat/sidebar/stats views), agents.go, and vulnerabilities.go. Pure file moves; no logic changes.
- tui/backend/projection.py: wire-safe state/collection projections, provider record serializer, and size limits, out of controller.py - tui/sidecar.py: sidecar process launch, credential-scrubbed child environment, and socket authentication, out of runtime.py - interface/cli_args.py: argument parsing and resume-state loading, out of main.py - interface/environment.py: environment validation and Docker image management, out of main.py - config/provider_detection.py: pure credential/environment detection predicates, out of config/providers.py Pure moves plus import updates; no behavior changes.
Sidecar resolution is now deterministic: a source checkout with Go runs the TUI via 'go run'; otherwise the packaged wheel binary is used.
…v-binary lookup The hidden --tui-protocol-smoke flag, Go --handshake-smoke mode, and ProtocolSmoke client path existed only for the release smoke checks that were removed from the release workflow. STRIX_TUI_LOG debug redirection and the build/sidecar dev-binary lookup in binary_command were optional escape hatches; sidecar resolution is now: go run in a source checkout, else the packaged wheel binary.
Wheels are platform wheels with the compiled sidecar; the universal sidecar-free wheel path and its STRIX_REQUIRE_TUI_SIDECAR gate are gone, so a missing Go toolchain fails the build instead of shipping an install without an interactive interface. Editable installs still need no Go. The hook now lives in build_hooks/tui_sidecar.py, and the redundant tui-run make target is removed.
Interactive launches now open the Bubble Tea UI first and run the model preflight, run preparation and telemetry behind a visible 'Preparing scan' state, so the agent loop can never start before the interface is up. A rejected saved key drops the live session into setup instead of exiting. Also moves the wheel build hook next to the other build scripts.
Dragging in the chat trace highlights text (reverse video) and copies the plain-text selection to the clipboard on release, tmux-style, since terminal mouse capture prevents native selection. Selection coordinates are anchored to content lines so scrolling keeps the highlight in place.
Copying a selection now pops a bottom-right 'Copied to clipboard' toast, matching the old Textual notify() behavior, and both the toast and the highlight clear after two seconds.
Un-closed requests responses are finalized by the garbage collector at interpreter exit, which surfaces as 'Exception ignored ... ValueError: I/O operation on closed file' from urllib3 after the TUI exits. Every plain requests call now runs in a context manager so connections are released deterministically.
…ut selection - Chat composer is a bubbles textarea: Enter submits, Shift+Enter / Alt+Enter / Ctrl+J insert a newline, and it grows with content up to 8 lines (matching the old Textual ChatTextArea) - Fenced code blocks and vulnerability PoC code are syntax-highlighted via chroma (terminal256, native style), mirroring the old pygments path - Markdown tables render as aligned columns with a header rule - Drag-select and clipboard copy now also work inside the composer
…aiting errors, markdown vuln copy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
strix-tuisidecars in release wheels and frozen builds, with a safe Textual fallback for prepared scansBehavior
STRIX_TEXTUAL_TUI=1keeps the legacy Textual scan interface0600permissions/budget,/turns,/scope,/mount,/target-list, and/prompt-fileconfigure fresh runs before scan preparationmainsupport for custom request headers, non-streaming gateways, ChatGPT lookup safety, and structured provider refusals is preserved with route isolationScope
This PR is intentionally limited to the Go TUI, its Python backend, provider/model setup, startup integration, packaging, documentation, and directly required compatibility changes. It does not include the broader engine lifecycle, report transaction, compaction, dedupe, or workspace-hardening changes from the development branch.
Verification
uv run pytest(889 passed)ruff checkandruff format --checkmypygo vet ./...go test -race ./...gofmtcleansetup-run-controlscapability