P2-T5: Warn when --web-ui requested but running broker lacks it#128
Merged
Conversation
… running broker lacks it
…unning broker lacks it
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a user-facing warning for the “proxy requested --web-ui but connected to an already-running broker without the dashboard” scenario, improving UX without impacting the MCP JSON-RPC stream.
Changes:
- Add a post-connect TCP probe in
BrokerProxyto detect missing Web UI on the expected port and print an actionable stderr warning. - Thread the effective
web_ui_portfrom CLI intoBrokerProxy. - Add unit tests and archive/spec documentation updates for P2-T5.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/mcpbridge_wrapper/broker/proxy.py |
Adds web_ui_port, _new_broker_spawned, and _warn_web_ui_mismatch() probe + warning logic. |
src/mcpbridge_wrapper/__main__.py |
Passes web_ui_port into BrokerProxy in broker proxy mode. |
tests/unit/test_broker_proxy.py |
Adds TestBrokerProxyWebUIMismatch coverage for warning/probe behavior. |
SPECS/Workplan.md |
Marks P2-T5 as completed and updates acceptance criteria checklist. |
SPECS/INPROGRESS/next.md |
Archives P2-T5 and updates idle status/recently archived list. |
SPECS/ARCHIVE/_Historical/REVIEW_P2-T5_webui_mismatch_warning.md |
Adds historical review report for P2-T5. |
SPECS/ARCHIVE/P2-T5_Warn_when_broker_lacks_web_ui/P2-T5_Warn_when_broker_lacks_web_ui.md |
Adds PRD/spec for the implemented behavior. |
SPECS/ARCHIVE/P2-T5_Warn_when_broker_lacks_web_ui/P2-T5_Validation_Report.md |
Adds validation report and quality gate results. |
SPECS/ARCHIVE/INDEX.md |
Adds P2-T5 to archive index and updates last-updated metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
When the user starts a proxy with
--broker --web-uiand a broker daemon is already running without the web UI, the proxy connects silently and--web-uihas no effect — the user sees no dashboard and no explanation.Fix: After connecting to an existing broker (not one we just spawned),
BrokerProxyprobes127.0.0.1:{web_ui_port}with a 0.5 s TCP timeout. If the port is not accepting connections, an actionable warning is printed to stderr:The MCP session continues normally — the warning is stderr-only.
Changes:
src/mcpbridge_wrapper/broker/proxy.py— addedweb_ui_portparam,_new_broker_spawnedflag,_warn_web_ui_mismatch()helper, and mismatch check inrun()after connect; set_new_broker_spawned=Truebeforesubprocess.Popensrc/mcpbridge_wrapper/__main__.py— passes effective web UI port (web_ui_port or 8080whenweb_ui_enabled) toBrokerProxytests/unit/test_broker_proxy.py— addedTestBrokerProxyWebUIMismatch(5 tests)Type of Change
Quality Gates
make test- All tests pass with ≥90% coverage (737 passed, 91.66% coverage)make lint- No linting errors (ruff check src/passed)make format- Code is properly formatted (ruff format --checkpassed)make typecheck- Type checking passesmake doccheck- Documentation is synced with DocC (if docs changed)Documentation Sync
Testing
TestBrokerProxyWebUIMismatch)Checklist