fix(mcp): unblock Kimi models in OpenCode with preview tools - #5128
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved a9be6ba This PR restructures schema descriptions to avoid duplicate descriptions in You can customize Macroscope's approvability policy. Learn more. |
|
confirmed: keeping both descriptions is semantically reasonable, but Effect emits them as separate described members inside |
Absorbs pingdotgg/t3code main 3d42966 (2 commits): the Kimi preview-tools MCP fix (pingdotgg#5128) and remote updates with database migrations (pingdotgg#5374), which is also nightly v0.0.32-nightly.20260805.1002. merge-tree pre-check was conflict-free; overlapping paths carry only Turbo branding strings on our side. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
## What's Changed * fix(mcp): unblock Kimi models in OpenCode with preview tools by @hwanseoc in pingdotgg/t3code#5128 * fix(web): clear main branch lint warnings by @t3dotgg in pingdotgg/t3code#5384 * fix(mobile): preserve grouped project workspaces by @shivamhwp in pingdotgg/t3code#4642 * fix(mobile): prevent Android thread search crash by @shivamhwp in pingdotgg/t3code#5386 * fix(web): truncate long project switcher names by @FllipEis in pingdotgg/t3code#5348 * fix(mobile): avoid double dividers between thread sections by @shivamhwp in pingdotgg/t3code#5391 * fix(web): keep the composer command menu anchored to the composer by @StiensWout in pingdotgg/t3code#5336 * fix(web): restore terminal link hover styles by @StiensWout in pingdotgg/t3code#5382 * fix(ci): isolate releases from shared API rate limits by @t3dotgg in pingdotgg/t3code#5394 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260805.1002...v0.0.32-nightly.20260805.1005 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1005
I ran into OpenCode failing every turn with Kimi K3 when T3 Code exposed the
preview_navigateMCP tool.It was caused by the shared URL validator and the concrete field each adding a different description. Effect emitted both in
allOf, and Kimi rejects them when flattening the schema.The fix is to keep
BoundedUrlvalidation-only and merge the shared URL guidance into each concrete field description. Effect changes the generated schema from:{ "type": "string", "allOf": [ { "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$" }, { "minLength": 1, "description": "Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http." }, { "maxLength": 2048, "description": "Direct website URL." } ] }to:
{ "type": "string", "allOf": [ { "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$" }, { "minLength": 1 }, { "maxLength": 2048, "description": "Direct website URL. Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http." } ] }minLength,maxLength, and URL validation are unchanged. Only the descriptions are consolidated. Tested withvp test run apps/server/src/mcp/toolkits/preview/tools.test.ts.Note
Low Risk
Contract/schema annotation only; URL validation is unchanged and coverage is added for
preview_navigateschema shape.Overview
Fixes OpenCode failures with Kimi K3 when
preview_navigate(and related preview MCP tools) expose URL fields whose Effect JSON schema had more than onedescriptioninsideallOf. Kimi rejects that shape when flattening tool schemas.BoundedUrlis now validation-only (trim, non-empty, max length) with no description on the sharedisNonEmpty()check. Shared URL format guidance lives inURL_GUIDANCEand is inlined into each concrete field description onPreviewAutomationOpenInput,PreviewAutomationNavigateInput, andBrowserNavigationTargetURL fields.A regression test in
tools.test.tsassertspreview_navigatenever emits schemas with multiple describedallOfmembers. URL validation rules are unchanged; only how descriptions are attached to the generated JSON schema.Reviewed by Cursor Bugbot for commit 63628e6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Kimi model compatibility by removing multiple
allOfdescriptions frompreview_navigateschemaURL_GUIDANCEconstant and inlines it into theurlfield descriptions forPreviewAutomationNavigateInput,PreviewAutomationOpenInput, andBrowserNavigationTargetin previewAutomation.ts.BoundedUrlisNonEmpty()check to avoid generating multiple describedallOfmembers in the compiled JSON schema, which Kimi models reject.schemaHasMultipleAllOfDescriptionshelper in tools.test.ts and asserts thatpreview_navigatenever produces such a schema.Macroscope summarized 63628e6.