From d5da3782da0616362a17f6945bf641dfadea8484 Mon Sep 17 00:00:00 2001 From: Q00 Date: Mon, 25 May 2026 19:25:19 +0900 Subject: [PATCH] docs(mcp): refresh metadata transport comments Update stale comments that still described FastMCP metadata as dropped after PR #1210 preserved meta across the transport path. The text now distinguishes structured metadata preservation from content-based compatibility for bridge clients.\n\nServices: shared\nAffected files:\n- src/ouroboros/mcp/tools/subagent.py\n- src/ouroboros/mcp/tools/evaluation_handlers.py --- src/ouroboros/mcp/tools/evaluation_handlers.py | 7 +++---- src/ouroboros/mcp/tools/subagent.py | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ouroboros/mcp/tools/evaluation_handlers.py b/src/ouroboros/mcp/tools/evaluation_handlers.py index fbebf8b2b..96254310b 100644 --- a/src/ouroboros/mcp/tools/evaluation_handlers.py +++ b/src/ouroboros/mcp/tools/evaluation_handlers.py @@ -1466,10 +1466,9 @@ async def handle( # too, so non-plugin runtimes (Claude Code, Codex CLI, OpenCode # subprocess) can drive their own sub-agent fan-out from the # same structured prompts that plugin mode dispatches via - # `_subagents`. The FastMCP adapter only forwards `text_content` - # to the wire (`adapter.py:923`); `meta` is dropped. So the - # dispatch payload has to ride inside `content` to survive - # transport. + # `_subagents`. The FastMCP adapter now preserves `meta`, but + # older bridge consumers still read only `text_content`, so the + # dispatch payload continues to ride inside `content`. # # Format: a hidden HTML-comment block with a versioned sentinel, # carrying the dispatch JSON base64-encoded inside the comment. diff --git a/src/ouroboros/mcp/tools/subagent.py b/src/ouroboros/mcp/tools/subagent.py index 7f4fc519f..27e33b8eb 100644 --- a/src/ouroboros/mcp/tools/subagent.py +++ b/src/ouroboros/mcp/tools/subagent.py @@ -194,10 +194,10 @@ def build_subagent_result( ) -> Result: """Wrap a SubagentPayload into an MCPToolResult for MCP transport. - The payload is serialized as JSON text in the content field because the - FastMCP adapter only passes ``text_content`` through to the wire — the - ``meta`` dict is lost. The bridge plugin parses JSON from the text to - detect the ``_subagent`` key. + The payload is serialized as JSON text in the content field so bridge + clients can parse the ``_subagent`` key directly. ``meta`` is preserved + by the FastMCP adapter for structured clients, but content JSON remains + the compatibility surface for plugin bridge dispatch. Public-contract preservation (#442): when ``response_shape`` is provided, the natural tool response fields (e.g. ``session_id``, ``job_id``,