feat(tui): add Bubble Tea interface with provider setup #1
Workflow file for this run
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
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| python: | |
| name: Python ${{ matrix.python-version }} tests${{ matrix.python-version == '3.12' && ' and quality' || '' }} | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.12', '3.13', '3.14'] | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Test | |
| run: uv run pytest | |
| - name: Lint | |
| if: matrix.python-version == '3.12' | |
| run: | | |
| uv run ruff check \ | |
| hatch_build.py \ | |
| strix/config \ | |
| strix/core/execution.py \ | |
| strix/core/inputs.py \ | |
| strix/core/runner.py \ | |
| strix/interface/main.py \ | |
| strix/interface/interactive.py \ | |
| strix/interface/go_tui.py \ | |
| strix/interface/tui_backend \ | |
| strix/llm/compaction.py \ | |
| strix/llm/context_budget.py \ | |
| strix/report/dedupe.py \ | |
| tests/test_compaction.py \ | |
| tests/test_config_loader.py \ | |
| tests/test_config_providers.py \ | |
| tests/test_context_budget.py \ | |
| tests/test_dedupe_model.py \ | |
| tests/test_disable_streaming.py \ | |
| tests/test_execution.py \ | |
| tests/test_go_tui_runtime.py \ | |
| tests/test_inputs.py \ | |
| tests/test_llm_extra_headers.py \ | |
| tests/test_main_startup_recovery.py \ | |
| tests/test_models.py \ | |
| tests/test_packaging.py \ | |
| tests/test_provider_hints.py \ | |
| tests/test_tui_backend_controller.py \ | |
| tests/test_tui_backend_server.py \ | |
| tests/test_tui_dispatch.py | |
| - name: Format | |
| if: matrix.python-version == '3.12' | |
| run: | | |
| uv run ruff format --check \ | |
| hatch_build.py \ | |
| strix/config \ | |
| strix/core/execution.py \ | |
| strix/core/inputs.py \ | |
| strix/core/runner.py \ | |
| strix/interface/main.py \ | |
| strix/interface/interactive.py \ | |
| strix/interface/go_tui.py \ | |
| strix/interface/tui_backend \ | |
| strix/llm/compaction.py \ | |
| strix/llm/context_budget.py \ | |
| strix/report/dedupe.py \ | |
| tests/test_compaction.py \ | |
| tests/test_config_loader.py \ | |
| tests/test_config_providers.py \ | |
| tests/test_context_budget.py \ | |
| tests/test_dedupe_model.py \ | |
| tests/test_disable_streaming.py \ | |
| tests/test_execution.py \ | |
| tests/test_go_tui_runtime.py \ | |
| tests/test_inputs.py \ | |
| tests/test_llm_extra_headers.py \ | |
| tests/test_main_startup_recovery.py \ | |
| tests/test_models.py \ | |
| tests/test_packaging.py \ | |
| tests/test_provider_hints.py \ | |
| tests/test_tui_backend_controller.py \ | |
| tests/test_tui_backend_server.py \ | |
| tests/test_tui_dispatch.py | |
| - name: Type check | |
| if: matrix.python-version == '3.12' | |
| run: | | |
| uv run mypy \ | |
| strix/config \ | |
| strix/interface/main.py \ | |
| strix/interface/interactive.py \ | |
| strix/interface/go_tui.py \ | |
| strix/interface/tui_backend | |
| go: | |
| name: Go tests and quality | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version: '1.24.x' | |
| check-latest: true | |
| cache-dependency-path: tui-go/go.sum | |
| - name: Format | |
| working-directory: tui-go | |
| run: test -z "$(gofmt -l .)" | |
| - name: Vet | |
| working-directory: tui-go | |
| run: go vet ./... | |
| - name: Test with race detector | |
| working-directory: tui-go | |
| run: go test -race ./... | |
| source-package: | |
| name: Source package without Go | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.12' | |
| - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 | |
| - name: Build source and universal wheel with Go unavailable | |
| shell: bash | |
| run: | | |
| UV_BIN=$(command -v uv) | |
| NO_GO_PATH="$RUNNER_TEMP/path-without-go" | |
| mkdir -p "$NO_GO_PATH" "$RUNNER_TEMP/source-dist" "$RUNNER_TEMP/source-wheel" | |
| unset STRIX_REQUIRE_TUI_SIDECAR | |
| PATH="$NO_GO_PATH" "$UV_BIN" build --sdist --out-dir "$RUNNER_TEMP/source-dist" | |
| SDISTS=("$RUNNER_TEMP/source-dist"/*.tar.gz) | |
| test "${#SDISTS[@]}" -eq 1 | |
| SDIST="${SDISTS[0]}" | |
| PATH="$NO_GO_PATH" "$UV_BIN" build --wheel "$SDIST" --out-dir "$RUNNER_TEMP/source-wheel" | |
| "$UV_BIN" venv --python 3.12 "$RUNNER_TEMP/editable" | |
| PATH="$NO_GO_PATH" "$UV_BIN" pip install \ | |
| --python "$RUNNER_TEMP/editable/bin/python" --no-deps --editable . | |
| - name: Verify universal wheel | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import pathlib | |
| import zipfile | |
| wheels = list(pathlib.Path("${{ runner.temp }}/source-wheel").glob("*.whl")) | |
| assert len(wheels) == 1, wheels | |
| assert wheels[0].name.endswith("-py3-none-any.whl"), wheels[0] | |
| with zipfile.ZipFile(wheels[0]) as archive: | |
| names = archive.namelist() | |
| assert "strix/bin/strix-tui" not in names | |
| assert "strix/bin/strix-tui.exe" not in names | |
| assert "strix/interface/tui/app.py" in names | |
| assert "strix/interface/assets/tui_styles.tcss" in names | |
| wheel_metadata = archive.read( | |
| next(name for name in names if name.endswith(".dist-info/WHEEL")) | |
| ).decode() | |
| assert "Root-Is-Purelib: true" in wheel_metadata | |
| assert "Tag: py3-none-any" in wheel_metadata | |
| PY | |
| strict-linux-wheel: | |
| name: Strict Linux wheel | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.12' | |
| - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version: '1.24.x' | |
| check-latest: true | |
| cache-dependency-path: tui-go/go.sum | |
| - name: Build strict wheel | |
| env: | |
| STRIX_REQUIRE_TUI_SIDECAR: '1' | |
| STRIX_WHEEL_PLATFORM_TAG: manylinux_2_17_x86_64 | |
| run: uv build --wheel --out-dir dist/strict | |
| - name: Verify and install strict wheel | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import pathlib | |
| import zipfile | |
| wheels = list(pathlib.Path("dist/strict").glob("*.whl")) | |
| assert len(wheels) == 1, wheels | |
| assert wheels[0].name.endswith("-py3-none-manylinux_2_17_x86_64.whl"), wheels[0] | |
| with zipfile.ZipFile(wheels[0]) as archive: | |
| names = archive.namelist() | |
| assert "strix/bin/strix-tui" in names | |
| wheel_metadata = archive.read( | |
| next(name for name in names if name.endswith(".dist-info/WHEEL")) | |
| ).decode() | |
| assert "Root-Is-Purelib: false" in wheel_metadata | |
| PY | |
| uv venv --python 3.12 .strict-wheel-smoke | |
| uv pip install --python .strict-wheel-smoke/bin/python dist/strict/*.whl | |
| .strict-wheel-smoke/bin/strix --version | |
| - name: Run installed-wheel protocol handshake | |
| run: .strict-wheel-smoke/bin/strix --tui-protocol-smoke |