fix: preserve full workspace MCP tool input schemas from agent to coderd - #28377
Draft
ibetitsmike wants to merge 1 commit into
Draft
fix: preserve full workspace MCP tool input schemas from agent to coderd#28377ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
ibetitsmike
force-pushed
the
mike/mcp-full-schema-workspace
branch
from
August 20, 2026 13:05
32a7a72 to
1dafa4d
Compare
ibetitsmike
force-pushed
the
mike/mcp-full-schema-workspace
branch
from
August 20, 2026 13:26
1dafa4d to
c7c8182
Compare
ibetitsmike
force-pushed
the
mike/mcp-full-schema-workspace
branch
from
August 20, 2026 13:59
c7c8182 to
22409f9
Compare
ibetitsmike
force-pushed
the
mike/mcp-full-schema-workspace
branch
from
August 20, 2026 21:15
22409f9 to
c280e20
Compare
The workspace MCP path lost schema fidelity twice: the agent kept only type, properties, and required before proto encoding, and coderd re-split the pushed proto Struct into a properties map plus required list for the tool wrapper. Keys such as $defs, $ref, additionalProperties, and combinators never reached the provider. Pass the schema map through the agent whole (the proto Struct already carries arbitrary JSON objects), add MCPToolInfo.InputSchema for the complete schema alongside the flattened Schema/Required pair, and let WorkspaceMCPTool expose it through FullInputSchema so the chatloop wire path prefers it. Old agents push the reduced schema, which is itself a valid schema, so the same path serves both payload generations without version detection.
ibetitsmike
force-pushed
the
mike/mcp-full-schema-workspace
branch
from
August 25, 2026 10:06
c280e20 to
39d10e1
Compare
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.
The workspace MCP path lost tool schema fidelity twice: the workspace agent kept only
type,properties, andrequiredbefore proto encoding (agentmcp.toolInputSchemaMap), and coderd re-split the pushed protoStructinto a properties map plus required list for the tool wrapper (splitMCPInputSchema). Keys such as$defs,$ref,additionalProperties, and combinators never reached the provider.google.protobuf.Structalready carries arbitrary JSON objects, so no proto change is needed.workspacesdk.MCPToolInfogains anInputSchemafield for the complete schema. The flattenedSchema/Requiredpair stays populated with today's semantics for existing consumers.WorkspaceMCPToolstores the full schema and exposes it throughFullInputSchema(), so the chatloop wire path from the previous PR prefers it.Old agents push the reduced
{type, properties, required}schema, which is itself a valid JSON Schema, so the same code path serves both payload generations without version detection. Payloads with no schema at all fall back to reconstruction fromInfo().Stack Context
Top of a stack that fixes MCP tool input-schema loss end to end: below, the
properties: nullfix and the chatd-side full-schema passthrough for external MCP and dynamic tools.