BUG-T8: Fix broker proxy bridge exits after first write due to BaseProtocol missing _drain_helper#123
Merged
SoundBlaster merged 12 commits intomainfrom Mar 1, 2026
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ue to BaseProtocol missing _drain_helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… to BaseProtocol missing _drain_helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, fix test isolation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…due to BaseProtocol missing _drain_helper (PASS) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…th in docs ~/.mcpbridge_wrapper/ remains the broker runtime dir (socket, PID, log). ~/.config/xcodemcpwrapper/ is the user-facing config dir using the recognisable tool name rather than the internal package name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add the missing 'Using Make Commands' subsection to WebUIDashboard.md to mirror the same section in docs/webui-setup.md. Also add the ./scripts/install.sh --webui install option to docs/webui-setup.md to match WebUIDashboard.md. Both files now share the same commit, satisfying the strict DocC same-commit sync requirement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22a1f37 to
a6557f2
Compare
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
Fixes a silent protocol mismatch in
BrokerProxy._make_stdout_writer(src/mcpbridge_wrapper/broker/proxy.py).asyncio.BaseProtocolwas used as the protocol forloop.connect_write_pipe, butasyncio.StreamWriter.drain()callsprotocol._drain_helper()which onlyFlowControlMixin(notBaseProtocol) implements. On every first write theAttributeErrorwas swallowed by_forward_stream's broadexcept Exception: return, causing thesocket→stdoutbridge task to exit immediately after theinitializeresponse.asyncio.wait(FIRST_COMPLETED)then cancelled the other direction and the proxy process terminated — so all MCP clients using--broker-spawnor--broker-connectreceivedinitializebut never receivedtools/list, showing 0 tools.Fix: replace
asyncio.BaseProtocolwithasyncio.StreamReaderProtocol(inheritsFlowControlMixin, implements_drain_helper) — the standard asyncio streams pattern.Also fixes a pre-existing test isolation bug in
TestBrokerProxyBasic:setup_methodusedBrokerConfig.default()which pointed to~/.mcpbridge_wrapper/broker.sock. When a live broker was running, the socket existed andtest_run_raises_timeout_when_no_socketreached_make_stdin_readerinstead of timing out, failing withUnsupportedOperation. Fixed by using atempfile.mkdtemp()socket path guaranteed not to exist.Closes / implements: BUG-T8
Type of Change
Quality Gates
make test- All tests pass with ≥90% coverage (715 passed, 5 skipped; coverage 91.61%)make lint- No linting errors (ruff check src/clean)make format- Code is properly formattedmake typecheck- Type checking passes (mypy src/— no issues in 18 files)make doccheck- Documentation is synced with DocC (if docs changed)Documentation Sync
Testing
TestBrokerProxyBasic.setup_methodtest isolation--broker-connectreturns 20 tools through the full initialize → notifications/initialized → tools/list sequenceChecklist