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

Skip to content

fix(coderd/x/chatd/mcpclient): serialize parameterless tool schemas with empty properties - #28373

Draft
ibetitsmike wants to merge 1 commit into
mainfrom
mike/fix-mcp-nil-properties-schema
Draft

fix(coderd/x/chatd/mcpclient): serialize parameterless tool schemas with empty properties#28373
ibetitsmike wants to merge 1 commit into
mainfrom
mike/fix-mcp-nil-properties-schema

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

MCP tools whose inputSchema omits "properties" (no-argument tools) produced a nil parameters map, which serialized the wire tool schema as "properties": null. Some providers reject a null properties object as an invalid schema.

#28380 (merged) guards the wire sink (chatloop.buildToolDefinitions). This PR normalizes the other half: mcpclient.splitInputSchema returns an empty object instead of nil, so Info().Parameters is never nil for consumers beyond the wire path (model-intent wrapping, tool search), mirroring the existing nil-required guard.

Stack Context

Bottom of a stack that fixes MCP tool input-schema loss end to end: this PR fixes the remaining properties: null corruption at the schema split, the next PRs preserve full input schemas ($defs, $ref, additionalProperties, ...) through chatd and the workspace MCP path instead of flattening them to properties + required.

🤖 Mux authored this PR on Mike's behalf.

@ibetitsmike ibetitsmike changed the title mike/fix mcp nil properties schema fix(coderd/x/chatd): serialize parameterless tool schemas with empty properties Aug 20, 2026
@ibetitsmike
ibetitsmike force-pushed the mike/fix-mcp-nil-properties-schema branch from f7d9d42 to cdabdd0 Compare August 20, 2026 13:05
@ibetitsmike
ibetitsmike changed the base branch from main to fix/chatd-openai-null-tool-properties August 20, 2026 13:07
@ibetitsmike ibetitsmike changed the title fix(coderd/x/chatd): serialize parameterless tool schemas with empty properties fix(coderd/x/chatd/mcpclient): serialize parameterless tool schemas with empty properties Aug 20, 2026
@ibetitsmike
ibetitsmike force-pushed the mike/fix-mcp-nil-properties-schema branch from cdabdd0 to a789f93 Compare August 20, 2026 13:26
An error occurred while trying to automatically change base from fix/chatd-openai-null-tool-properties to main August 20, 2026 13:57
@ibetitsmike
ibetitsmike changed the base branch from fix/chatd-openai-null-tool-properties to main August 20, 2026 13:59
@ibetitsmike
ibetitsmike force-pushed the mike/fix-mcp-nil-properties-schema branch 2 times, most recently from 55e99dc to 1aa2d81 Compare August 20, 2026 21:15
…ith empty properties

MCP tools whose inputSchema omits "properties" (no-argument tools)
produced a nil Parameters map, which serialized the wire schema as
"properties": null. Some providers reject a null properties object.
Normalize to an empty object where MCP schemas are split, so
Info().Parameters is never nil for consumers beyond the wire path,
complementing the nil-properties guard in buildToolDefinitions.
@ibetitsmike
ibetitsmike force-pushed the mike/fix-mcp-nil-properties-schema branch from 1aa2d81 to 09ea919 Compare August 25, 2026 10:06
@github-actions github-actions Bot added the stale This issue is like stale bread. label Sep 13, 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