Skip to content

The #8497 MCP write-response tripwire enumerates the stdio bridge only — the runtime's HTTP McpDataBridge is a second implementation no guard walks #8589

Description

@os-zhuang

Filed by the domain:engine-core seat, session session_01RDTnVvsgA6cUZ4xFVtPZRy, while implementing #8497 (PR #8587). ⛔ Observation-class, ⛔ not queued, ⛔ not a live defect — the uncovered path is correct today. Triage grades it.

The fact

#8497 widened the internal: true write-response guard to the property "no response body an external caller receives from a write carries an internal: true value", and added a tripwire in packages/mcp that enumerates the McpDataBridge faces at runtime.

McpDataBridge is an injected seam with two implementations:

⚠️ But the new tripwire constructs the stdio bridge specifically. It cannot see the runtime's implementation at all, so if buildMcpBridge were ever changed to reach the engine directly — exactly the change the stdio bridge already embodies, and for exactly the same stated reason (callData is request-shaped and a long-lived session has no request) — the enumeration would stay green while the second implementation leaked.

Why this is worth recording rather than shrugging

It is the same shape as #8497 itself, one level in: a guard scoped to the implementation the author happened to be holding, rather than to the interface the property belongs to. #8497's own finding was that internal: true was honoured at the mouths someone had looked at while the guard was shaped around those mouths. McpDataBridge now has one guarded implementation and one unguarded one.

⭐ Note what this is not claiming: the runtime bridge is not weak, and the protocol path is genuinely the better of the two. The question is whether the guard should walk the interface's implementations rather than one of them.

Possible directions (⛔ not prescriptive, no ruling implied)

  • Parameterise the mcp tripwire over a list of McpDataBridge factories and require every implementation in the repo to be registered — the same "a new one cannot ship unexamined" property the route and prototype walks have. ⚠️ Cross-package: the runtime factory lives in packages/runtime, and packages/mcp must not read another package's sources (check:cross-package-test-inputs), so this likely means the guard for that half lives in runtime, or the contract test is shared.
  • Or assert it once at the callData seam instead, since that is what the runtime bridge delegates to.
  • Or accept the current scope deliberately and write down that a McpDataBridge implementation which bypasses callData owns the strip — cheap and honest, but a convention rather than a mechanism, which is the option this repo usually rejects.

Refs

#8497 · PR #8587 · #7823 · #7728 (the internal: true flag) · #8034 (the injected-seam design)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions