fix(server): mirror structured MCP results into text - #2794
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean additive patch.
This PR mirrors MCP structuredContent into a trailing TextContent block for text-only hosts. The reviewer verified witness-fidelity (exact serialization, no fabrication or reshaping), content[] null-safety, that ctx_metadata/error-envelope stripping precedes serialization (no secret leak), dedup/double-append correctness, and changeset presence. No Critical/High/Medium findings.
Decision-table walkthrough: no critical/high findings (row 1 n/a); gated_paths is false (row 2 n/a); high_risk is false with no deletions (rows 3–5 n/a); no prior decision (row 6 n/a); no no-auto-approve team match (row 7 n/a); zero medium findings (row 8 n/a). Falls through to row 9 → approve.
Note: review_decision is REVIEW_REQUIRED, but with gated_paths: false this does not gate the outcome.
|
CI triage: the Webhook Delivery Backends failure was a lease-test timeout and passed on retry. The remaining Generated, Docs & Formatting failure is unrelated registry-source drift: the job regenerates changes in schemas/registry/registry.yaml and src/lib/registry/types.generated.ts from the external registry OpenAPI, while this PR changes only create-adcp-server.ts, its focused test, and one changeset. Retrying reproduced the same external diff. I have not weakened the check or committed unrelated generated artifacts. |
|
Acknowledged. The CI triage makes sense — lease-test timeout resolved on retry, and the registry-source drift in Generated by Claude Code |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Clean pass with no critical, high, or medium findings. The delta since the prior approve is a canonical registry OpenAPI sync (schemas/registry/registry.yaml) plus its regenerated exempt types file (src/lib/registry/types.generated.ts). The YAML and generated types are internally consistent across the new async-refresh endpoint, agent_visibility_summary, and Retry-After headers. Witness-not-translator holds — no fabrication or re-shaping. A changeset (.changeset/calm-tools-show.md) is present, and server + test changes are consistent.
Decision-table walkthrough:
- Row 1 (critical/high): no such findings.
- Row 2 (gated_paths): gated_paths is false — does not fire despite review_decision REVIEW_REQUIRED.
- Row 3 (deleted high-risk path): no deletions.
- Row 4/5 (medium on schema / modified high-risk file): no medium findings.
- Row 6 (sticky escalate): prior decision was approve — n/a.
- Row 7 (no-auto-approve team): no match.
- Row 8 (≥3 medium): zero medium findings.
high_risk is true only because schemas/registry/registry.yaml was modified, but the reviewer found no medium-or-higher concern, so the modification is presumed safe. Falls through to row 9 → approve.
|
CI is fully green on eb101d8. The externally sourced registry OpenAPI drift was regenerated with the canonical sync command and verified idempotent; all generated/docs/formatting, typecheck/build, fast + slow unit, adapter integration, reference-seller, security, and automated review checks pass. This PR is ready for review/merge. |
Summary
structuredContentJSON as aTextContentfallback on all SDK server responsesWhy
MCP clients such as the current Claude hosted connector can expose content text to the model without exposing
structuredContent. SDK v14 response builders only put summaries such as “Found 5 products” in text, so complete product data disappeared on those hosts.The MCP tools specification recommends mirroring structured results into text for backwards compatibility.
This did not cause Scope3 AI-7680 seller dispatch failures; that outage was an inactive deployment-barrier flag. It does fix the separate v14 host-compatibility regression exposed by the retest.
Verification
npm run build:libnpm run typechecknpm run generate-registry-types -- --sync(second run: no changes)NODE_ENV=test node --test test/server-create-adcp-server.test.js(156 passed)npx prettier --check src/lib/server/create-adcp-server.ts test/server-create-adcp-server.test.js