Skip to content

P13-T3: Implement multi-client transport and JSON-RPC multiplexing#65

Merged
SoundBlaster merged 12 commits into
mainfrom
feature/P13-T3-multi-client-transport
Feb 18, 2026
Merged

P13-T3: Implement multi-client transport and JSON-RPC multiplexing#65
SoundBlaster merged 12 commits into
mainfrom
feature/P13-T3-multi-client-transport

Conversation

@SoundBlaster
Copy link
Copy Markdown
Owner

Description

Implements P13-T3: full UnixSocketServer in src/mcpbridge_wrapper/broker/transport.py, replacing the P13-T1 stub. The server accepts concurrent Unix domain socket connections from MCP clients and multiplexes their JSON-RPC traffic through the single upstream xcrun mcpbridge subprocess owned by BrokerDaemon.

Key changes:

  • transport.py — full UnixSocketServer implementation: client accept loop, per-session handlers, request ID remapping (session_id << 20 | original_id), upstream write, response routing, notification broadcast, graceful shutdown with -32001 drain, and queue TTL enforcement during reconnection.
  • daemon.py — integrates UnixSocketServer as an optional transport parameter; starts/stops transport in start()/stop(); routes upstream stdout lines through transport.route_upstream_response().
  • test_broker_transport.py — 32 new tests covering concurrent clients, ID remapping, error isolation, reconnect TTL, graceful stop.
  • test_broker_stubs.py — replaced NotImplementedError assertions with instantiation tests (stubs now live).

Validation report: SPECS/ARCHIVE/P13-T3_Implement_multi-client_transport_and_JSON-RPC_multiplexing/P13-T3_Validation_Report.md

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD improvement

Quality Gates

Before submitting, ensure all quality gates pass:

make check

Or run individually:

  • make test - All tests pass with ≥90% coverage (550 passed, 5 skipped; 93.6% coverage)
  • make lint - No linting errors (ruff check src/ — all checks passed)
  • make format - Code is properly formatted
  • make typecheck - Type checking passes (mypy src/ — no issues in 18 files)
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

  • Documentation changes are synced with DocC catalog (or N/A) — no docs/ files changed

Testing

  • Added/updated tests for new functionality (32 new tests in test_broker_transport.py)
  • All tests pass locally (550 passed, 5 skipped)
  • Manually tested the changes (integration with live xcrun mcpbridge requires Xcode 26.3+)

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code (ID remapping logic documented in module docstring and inline)
  • Documentation updated (if needed) — N/A
  • No new warnings generated
  • PR title is descriptive

@SoundBlaster SoundBlaster merged commit 6f7963a into main Feb 18, 2026
9 checks passed
@SoundBlaster SoundBlaster deleted the feature/P13-T3-multi-client-transport branch February 18, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant