|
| 1 | +# PRD: FU-P13-T4-2 — Implement or remove reconnect parameter in BrokerProxy |
| 2 | + |
| 3 | +**Created:** 2026-02-18 |
| 4 | +**Priority:** P2 |
| 5 | +**Branch:** `codex/feature/FU-P13-T4-2-reconnect-parameter` |
| 6 | +**Status:** PLAN |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## 1. Problem Statement |
| 11 | + |
| 12 | +`BrokerProxy` accepts a `reconnect` parameter, stores it, and documents reconnect behavior, but `_run_bridge` never reads this setting. This leaves dead configuration in the API and ambiguous expectations for callers. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## 2. Scope |
| 17 | + |
| 18 | +### In Scope |
| 19 | +- Remove the unused `reconnect` parameter from `BrokerProxy.__init__` and internal state. |
| 20 | +- Remove reconnect claims from proxy module docs/docstrings that no longer match behavior. |
| 21 | +- Update call sites and tests that pass `reconnect=`. |
| 22 | +- Add/adjust tests to ensure no dead reconnect API remains. |
| 23 | + |
| 24 | +### Out of Scope |
| 25 | +- Adding reconnect loop behavior to proxy I/O lifecycle. |
| 26 | +- Broker daemon reconnect logic (`broker/daemon.py`). |
| 27 | +- New CLI flags for reconnect tuning. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## 3. Deliverables |
| 32 | + |
| 33 | +1. `src/mcpbridge_wrapper/broker/proxy.py` |
| 34 | +- Remove `reconnect` constructor argument and `_reconnect` field. |
| 35 | +- Update docstrings to reflect current behavior (no proxy-level reconnect retry). |
| 36 | + |
| 37 | +2. `src/mcpbridge_wrapper/__main__.py` |
| 38 | +- Remove obsolete `reconnect=False` argument at proxy construction. |
| 39 | + |
| 40 | +3. `tests/unit/test_broker_proxy.py` |
| 41 | +- Keep coverage around proxy forwarding/connect/exit behavior and ensure API remains clean. |
| 42 | + |
| 43 | +4. `SPECS/INPROGRESS/FU-P13-T4-2_Validation_Report.md` |
| 44 | +- Record quality-gate results and acceptance evidence. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## 4. Acceptance Criteria |
| 49 | + |
| 50 | +- [ ] `BrokerProxy.__init__` no longer exposes an unused `reconnect` parameter. |
| 51 | +- [ ] No dead reconnect state remains in proxy implementation. |
| 52 | +- [ ] Relevant unit tests pass with updated API. |
| 53 | +- [ ] Full quality gates pass: |
| 54 | + - `pytest` |
| 55 | + - `ruff check src/` |
| 56 | + - `mypy src/` |
| 57 | + - `pytest --cov` (coverage >= 90%) |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 5. Dependencies |
| 62 | + |
| 63 | +- P13-T4 ✅ |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## 6. Risks and Mitigations |
| 68 | + |
| 69 | +- **Risk:** Existing callers may still pass `reconnect=` and break at runtime. |
| 70 | + - **Mitigation:** Update known call site (`__main__.py`) and run full test suite to catch hidden usage. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## 7. Validation Plan |
| 75 | + |
| 76 | +1. Search repository for `reconnect=` uses in proxy construction and remove obsolete usage. |
| 77 | +2. Run `pytest tests/unit/test_broker_proxy.py`. |
| 78 | +3. Run required quality gates and record outputs in validation report. |
| 79 | + |
| 80 | + |
| 81 | +--- |
| 82 | +**Archived:** 2026-02-18 |
| 83 | +**Verdict:** PASS |
0 commit comments