Select task FU-P13-T10: Implement explicit broker daemon entrypoint and operational CLI flows#85
Merged
Conversation
…nd operational CLI flows
- Add --broker-daemon flag to _parse_broker_args() (4-tuple return) - Wire BrokerDaemon + UnixSocketServer in main() daemon branch - Guard: broker-only flags never forwarded to xcrun mcpbridge - Update test_broker_proxy.py and test_main.py for 4-tuple unpacking - Add TestMainBrokerDaemonMode with 5 new unit tests (all pass) - Replace Python one-liner in docs/broker-mode.md with first-class CLI
- Fix Low finding: add --broker-daemon to main() docstring - No blockers found; implementation approved with comments
Two lines in test_broker_proxy.py exceeded the 100-char limit after the _parse_broker_args 4-tuple refactor; wrap argument lists to fix E501. Also apply ruff formatter to __main__.py and test_main.py. https://claude.ai/code/session_015Zo26UDDy1d6kaRWgTxqtC
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
Implements FU-P13-T10: adds
--broker-daemonas a first-class CLI entrypoint for the persistent broker host.Previously, starting the broker daemon required a raw Python one-liner. This change wires
BrokerDaemon+UnixSocketServerdirectly intomain()behind the--broker-daemonflag, making--broker-spawnfunctional end-to-end. Broker-only flags are never forwarded toxcrun mcpbridge.Key changes:
_parse_broker_args()from 3-tuple to 4-tuple (broker_daemon,broker_connect,broker_spawn,remaining)--broker-daemonstartup branch inmain()callingasyncio.run(daemon.run_forever())docs/broker-mode.mdto reflect the newmcpbridge-wrapper --broker-daemoncommandTestMainBrokerDaemonMode+ 2 parsing tests); all existing tests updated for 4-tuple unpackingType of Change
Quality Gates
make test— All tests pass with ≥90% coveragemake lint— No linting errorsmake format— Code is properly formattedmake typecheck— Type checking passesmake doccheck— Documentation is synced with DocC (if docs changed)Documentation Sync
docs/broker-mode.mdupdated; no corresponding DocC catalog entry exists forbroker-mode.md(N/A for DocC sync table).Testing
New tests added:
TestMainBrokerDaemonMode::test_main_broker_daemon_returns_0_on_successTestMainBrokerDaemonMode::test_main_broker_daemon_returns_0_on_keyboard_interruptTestMainBrokerDaemonMode::test_main_broker_daemon_returns_1_on_runtime_errorTestMainBrokerDaemonMode::test_main_broker_daemon_does_not_start_bridgeTestMainBrokerDaemonMode::test_main_broker_daemon_wires_transport_to_daemonTestParseBrokerArgs::test_broker_daemon_flagTestParseBrokerArgs::test_broker_daemon_not_in_remainingChecklist