Skip to content

fix(mcp): unblock Kimi models in OpenCode with preview tools - #5128

Merged
maria-rcks merged 2 commits into
pingdotgg:mainfrom
hwanseoc:fix/opencode-preview-url-schema
Aug 5, 2026
Merged

fix(mcp): unblock Kimi models in OpenCode with preview tools#5128
maria-rcks merged 2 commits into
pingdotgg:mainfrom
hwanseoc:fix/opencode-preview-url-schema

Conversation

@hwanseoc

@hwanseoc hwanseoc commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

I ran into OpenCode failing every turn with Kimi K3 when T3 Code exposed the preview_navigate MCP 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 BoundedUrl validation-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 with vp test run apps/server/src/mcp/toolkits/preview/tools.test.ts.


Open in Devin Review

Note

Low Risk
Contract/schema annotation only; URL validation is unchanged and coverage is added for preview_navigate schema 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 one description inside allOf. Kimi rejects that shape when flattening tool schemas.

BoundedUrl is now validation-only (trim, non-empty, max length) with no description on the shared isNonEmpty() check. Shared URL format guidance lives in URL_GUIDANCE and is inlined into each concrete field description on PreviewAutomationOpenInput, PreviewAutomationNavigateInput, and BrowserNavigationTarget URL fields.

A regression test in tools.test.ts asserts preview_navigate never emits schemas with multiple described allOf members. 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 allOf descriptions from preview_navigate schema

  • Moves URL format guidance into a shared URL_GUIDANCE constant and inlines it into the url field descriptions for PreviewAutomationNavigateInput, PreviewAutomationOpenInput, and BrowserNavigationTarget in previewAutomation.ts.
  • Removes the description from the BoundedUrl isNonEmpty() check to avoid generating multiple described allOf members in the compiled JSON schema, which Kimi models reject.
  • Adds a schemaHasMultipleAllOfDescriptions helper in tools.test.ts and asserts that preview_navigate never produces such a schema.

Macroscope summarized 63628e6.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 521f0b75-0959-4bfa-8d0c-ecc0b553fb33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 31, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved a9be6ba

This PR restructures schema descriptions to avoid duplicate descriptions in allOf arrays, fixing compatibility with certain AI model providers. The changes are purely metadata/documentation with no impact on runtime validation logic.

You can customize Macroscope's approvability policy. Learn more.

@t3-code

t3-code Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

confirmed: keeping both descriptions is semantically reasonable, but Effect emits them as separate described members inside allOf, which Kimi rejects. consolidating the shared guidance into each concrete field description is the right fix here; validation and guidance are preserved. no change requested.

@maria-rcks
maria-rcks merged commit 3d42966 into pingdotgg:main Aug 5, 2026
14 of 15 checks passed
gfsaaser24 pushed a commit to gfsaaser24/t3code that referenced this pull request Aug 5, 2026
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>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 5, 2026
## 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
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
vortechron pushed a commit to vortechron/void that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants