P7-T4: Add direct local-status fallback for TUI when dashboard API is unavailable#162
Merged
Merged
Conversation
…board API is unavailable
…board API is unavailable
…ard API is unavailable
…hboard API is unavailable (PASS)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Description
Add local-status fallback for the broker TUI (
--tui) when the dashboard API is unavailable.When HTTP requests to
/api/controlor/api/broker/statusfail,BrokerTUIClient.fetch_snapshot()now derives a best-effort broker diagnosis from local PID/socket/version files and returns a structuredlocal-fallbacksnapshot instead of a generic "unavailable" screen. The renderer clearly labels the runtime source and suppresses live stop-control when running on fallback data.Key changes in
src/mcpbridge_wrapper/tui.py:_build_local_fallback_broker()— classifies local state asrunning (local fallback)orstale local state_read_local_pid()/_read_local_version()— lightweight helpers for PID liveness and version file readsrender_screen()— showsRuntime Sourcelabel, fallback banners, and suppresses stop-control in fallback modeBrokerTUI._run_loop()— emits an informational message whensis pressed without live dashboard5 new tests in
tests/unit/test_tui.pycover all fallback paths.Validation report:
SPECS/ARCHIVE/P7-T4_Add_direct_local-status_fallback_for_TUI_when_dashboard_API_is_unavailable/P7-T4_Validation_Report.mdType of Change
Quality Gates
make test- All tests pass with ≥90% coverage (898 passed, 91.75% coverage)make lint- No linting errors (ruff check src/clean)make format- Code is properly formattedmake typecheck- Type checking passes (mypy src/— no issues in 20 files)make doccheck- Documentation is synced with DocC (if docs changed)Documentation Sync
Testing
Checklist