Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: preserve full workspace MCP tool input schemas from agent to coderd - #28377

Draft
ibetitsmike wants to merge 1 commit into
mike/mcp-full-schema-chatdfrom
mike/mcp-full-schema-workspace
Draft

fix: preserve full workspace MCP tool input schemas from agent to coderd#28377
ibetitsmike wants to merge 1 commit into
mike/mcp-full-schema-chatdfrom
mike/mcp-full-schema-workspace

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

The workspace MCP path lost tool schema fidelity twice: the workspace agent kept only type, properties, and required before proto encoding (agentmcp.toolInputSchemaMap), and coderd re-split the pushed proto Struct into a properties map plus required list for the tool wrapper (splitMCPInputSchema). Keys such as $defs, $ref, additionalProperties, and combinators never reached the provider.

  • The agent now passes the schema map through whole; the proto google.protobuf.Struct already carries arbitrary JSON objects, so no proto change is needed.
  • workspacesdk.MCPToolInfo gains an InputSchema field for the complete schema. The flattened Schema/Required pair stays populated with today's semantics for existing consumers.
  • WorkspaceMCPTool stores the full schema and exposes it through FullInputSchema(), 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 from Info().

Stack Context

Top of a stack that fixes MCP tool input-schema loss end to end: below, the properties: null fix and the chatd-side full-schema passthrough for external MCP and dynamic tools.

🤖 Mux authored this PR on Mike's behalf.

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
ibetitsmike force-pushed the mike/mcp-full-schema-workspace branch from c280e20 to 39d10e1 Compare August 25, 2026 10:06
@github-actions github-actions Bot added the stale This issue is like stale bread. label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant