Skip to content

Seed host tool image policies#3016

Open
ignaciojimenezr wants to merge 1 commit into
mainfrom
tool-image-client-matrix
Open

Seed host tool image policies#3016
ignaciojimenezr wants to merge 1 commit into
mainfrom
tool-image-client-matrix

Conversation

@ignaciojimenezr

@ignaciojimenezr ignaciojimenezr commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Seeded per-host MCP tool-result image visibility and rendering policies into the seed host templates so each client shows images correctly. Adds tests to fix the matrix.

  • New Features
    • Populate modelVisibleMcpToolResults and mcpToolResultImageRendering for all host templates based on the observed client matrix.
    • Add small helpers to build these policies and tests to lock expected behavior, including VS Code rendering images inline for direct, embedded, and linked shapes.

Written for commit 6e342eb. Summary will update on new commits.

Review in cubic

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@dosubot dosubot Bot added the enhancement New feature or request label Jul 3, 2026
@chelojimenez

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-3016.up.railway.app
Deployed commit: 6c4b300
PR head commit: 6e342eb
Backend target: staging fallback.
Health: ✅ Convex reachable
Access is employee-only in non-production environments.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR adds two local helper functions in the SDK host-config seed template module for constructing modelVisibleMcpToolResults and mcpToolResultImageRendering policy objects. These helpers are used to explicitly seed tool-image visibility and rendering behavior for twelve built-in host templates (claude, chatgpt, mistral, goose, cursor, codex, copilot, vscode, n8n, perplexity, cline, notion), each with distinct direct/embedded/linked visibility flags and rendering placements. Corresponding test coverage is added to validate the seeded policy values per template and to verify vscode's inline rendering configuration across image shapes.

Changes

Cohort / File(s) Summary
Helper functions (seed-host-template.ts) Added two local helpers building tool-image visibility and rendering policy objects
Template seeding (seed-host-template.ts) Explicitly set modelVisibleMcpToolResults and mcpToolResultImageRendering per host template
Tests (host-config-seed-host-template.test.ts) Added assertions for seeded image policy values across templates and vscode-specific rendering

Sequence Diagram(s)

Not applicable — changes are declarative policy assignments rather than runtime interaction flows.

Related PRs: None identified.

Suggested labels: sdk, host-config, tests

Suggested reviewers: None identified.

Poem
A rabbit hopped through templates twelve,
Setting flags where visions delve—
Direct, embedded, linked in view,
Inline or collapsed, none or true.
With tests to prove each seeded claim,
The burrow's policies now the same. 🐇

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

sdk/src/host-config/templates/seed-host-template.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

YAMLException: Cannot read config file: /sdk/eslint.config.mjs
Error: end of the stream or a document separator is expected (10:20)

7 | ...tseslint.configs.recommended,
8 | prettier,
9 | {
10 | languageOptions: {
-------------------------^
11 | parserOptions: {
12 | project: ["./tsconfig.json", "./tests/tsco ...
at generateError (/node_modules/js-yaml/lib/loader.js:199:10)
at throwError (/node_modules/js-yaml/lib/loader.js:203:9)
at readDocument (/node_modules/js-yaml/lib/loader.js:1651:5)
at loadDocuments (/node_modules/js-yaml/lib/loader.js:1694:5)
at Object.load (/node_modules/js-yaml/lib/loader.js:1720:19)
at loadLegacyConfigFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2565:21)
at loadConfigFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2680:20)
at ConfigArrayFactory._loadConfigData (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2984:42)
at ConfigArrayFactory.loadFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2850:40)
at createCLIConfigArray (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3660:35)

sdk/tests/host-config-seed-host-template.test.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

YAMLException: Cannot read config file: /sdk/eslint.config.mjs
Error: end of the stream or a document separator is expected (10:20)

7 | ...tseslint.configs.recommended,
8 | prettier,
9 | {
10 | languageOptions: {
-------------------------^
11 | parserOptions: {
12 | project: ["./tsconfig.json", "./tests/tsco ...
at generateError (/node_modules/js-yaml/lib/loader.js:199:10)
at throwError (/node_modules/js-yaml/lib/loader.js:203:9)
at readDocument (/node_modules/js-yaml/lib/loader.js:1651:5)
at loadDocuments (/node_modules/js-yaml/lib/loader.js:1694:5)
at Object.load (/node_modules/js-yaml/lib/loader.js:1720:19)
at loadLegacyConfigFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2565:21)
at loadConfigFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2680:20)
at ConfigArrayFactory._loadConfigData (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2984:42)
at ConfigArrayFactory.loadFile (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2850:40)
at createCLIConfigArray (/soundcheck/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3660:35)


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
sdk/src/host-config/templates/seed-host-template.ts (1)

549-559: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Sourcing comments missing for the new tool-image policy blocks.

Every other host-behavior value in this file (CSP directives, capabilities, hostContext) is anchored with a comment citing a live probe, doc reference, or explicit rationale (e.g., the Claude CSP block cites a "live claude.ai inner-iframe response CSP header captured 2026-05-18"). The twelve new modelVisibleMcpToolResults / mcpToolResultImageRendering blocks have no such attribution, making it hard for future maintainers to know whether these numbers came from a real client probe, the MCP Apps client-matrix doc, or a guess — and whether they should be revisited when a client's behavior changes.

Also applies to: 820-830, 985-995, 1097-1107, 1340-1350, 1448-1458, 1510-1520, 1672-1682, 1825-1835, 1870-1880, 1910-1920, 1952-1962

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sdk/src/host-config/templates/seed-host-template.ts` around lines 549 - 559,
Add sourcing comments above each new modelVisibleMcpToolResults and
mcpToolResultImageRendering block in seed-host-template.ts so the chosen
tool-image policy values are traceable to a live probe, doc reference, or
explicit rationale. Use the existing nearby comment style as a guide and anchor
the rationale to the relevant host-specific block names so future maintainers
can tell whether the values came from a client probe, the MCP Apps matrix, or a
deliberate fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@sdk/src/host-config/templates/seed-host-template.ts`:
- Around line 549-559: Add sourcing comments above each new
modelVisibleMcpToolResults and mcpToolResultImageRendering block in
seed-host-template.ts so the chosen tool-image policy values are traceable to a
live probe, doc reference, or explicit rationale. Use the existing nearby
comment style as a guide and anchor the rationale to the relevant host-specific
block names so future maintainers can tell whether the values came from a client
probe, the MCP Apps matrix, or a deliberate fallback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 579562f7-7742-4f78-bc5f-5e908dca0919

📥 Commits

Reviewing files that changed from the base of the PR and between 42323c4 and 6e342eb.

⛔ Files ignored due to path filters (1)
  • sdk/tests/__snapshots__/host-config-seed-host-template.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • sdk/src/host-config/templates/seed-host-template.ts
  • sdk/tests/host-config-seed-host-template.test.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants