[codex] fix MCP output schema contracts#851
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 5e7f807 | Commit Preview URL Branch Preview URL |
May 20 2026, 07:05 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 5e7f807 | May 20 2026, 07:05 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-google-discovery
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the MCP output schema/display mismatch and keeps regression coverage around the full contract.
For MCP tools, upstream
outputSchemadescribes the MCP result'sstructuredContent. Executor invocation data, however, is the full successful MCPCallToolResultobject underToolResult.ok.data:content, optionalstructuredContent, optional_meta, and optionalisError. The MCP plugin now registers tool output schemas as thatCallToolResultshape, nesting the upstream MCP schema understructuredContent.The
CallToolResultwrapper is derived from@modelcontextprotocol/sdk'sCallToolResultSchemarather than hand-written. Executor only substitutesstructuredContentwith the per-tool upstream output schema and narrows successful results toisError: false, so content block details and future MCP schema changes track the SDK. Top-level extra properties remain permitted because MCP'sResulttype is intentionally extensible.The PR also adds reusable output contract coverage through
typeCheckOutputTypeScript, which compiles a described tool output TypeScript type against an actual runtime output value. MCP tests use it against real invocation data, and the existing core tool-invoker tests now share the helper too.Root Cause
MCP discovery copied the upstream MCP
outputSchemadirectly into Executor's registered tool schema. That made the schema panel and generated output TypeScript describedataas the upstream structured payload, while the actual invocation returneddataas the full MCP call result envelope.Validation
bun run --cwd packages/core/sdk typecheckpasses with existing Effect language-service warningsbun run --cwd packages/core/execution typecheckpasses with existingsrc/promise.tswarningbun run --cwd packages/plugins/mcp typecheckpasses with existing Effect language-service warnings./node_modules/.bin/oxlint -c .oxlintrc.jsonc packages/plugins/mcp/src/sdk/plugin.ts packages/plugins/mcp/src/sdk/elicitation.test.ts packages/plugins/mcp/package.json bun.lock --deny-warningsbun run --cwd packages/core/sdk test -- src/testing/tool-output-contract.test.tsbun run --cwd packages/plugins/mcp test -- src/sdk/elicitation.test.ts -t "outputSchema|CallToolResult|refreshSource|structured MCP result"bun run --cwd packages/plugins/mcp test -- src/sdk/elicitation.test.ts