Skip to content

Include the artifact deep link in the inline widget result - #1505

Merged
RhysSullivan merged 1 commit into
mainfrom
artifact-url-in-inline-result
Jul 30, 2026
Merged

Include the artifact deep link in the inline widget result#1505
RhysSullivan merged 1 commit into
mainfrom
artifact-url-in-inline-result

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Why

The inline create-artifact / show-artifact result carried only code + artifactId; the web deep link existed only on the no-apps fallback path. But clients can lose a rendered widget in ways the server never sees — observed live: a reopened Claude Desktop transcript re-establishes the MCP session without ever re-reading ui://executor/shell.html (no resources/read on the wire) and renders the stored structured content as raw JSON. When that happens the model has no way to point the user back at the artifact.

What

deliverArtifact now resolves the deep link up front and passes it into the inline result too:

  • structuredContent gains url beside code and artifactId (only when the host knows its web origin — stdio hosts with no artifactUrl are unchanged).
  • The text content mentions the link, so the model can relay it without parsing the structured payload.
  • Fallback paths unchanged.

The shell reads only code/artifactId from the payload, so the extra field is inert for rendering clients.

Verification

  • New test: inline result carries the URL when artifactUrl is configured; existing inline test updated for the new field.
  • Full packages/hosts/mcp suite 170/170; typecheck, lint, format green.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
executor-cloud 62de5fb Jul 30 2026, 05:34 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 62de5fb Commit Preview URL

Branch Preview URL
Jul 30 2026, 05:34 PM

@RhysSullivan
RhysSullivan marked this pull request as ready for review July 30, 2026 17:29
The inline result carried only code + artifactId; the deep link existed
only on the no-apps fallback path. Clients can lose a rendered widget in
ways the server never sees (a reopened transcript that skips the ui://
resource re-read shows raw JSON), and then the URL in the tool result is
the model's only way to point the user back at the artifact. The text
content mentions it too, so the model can relay it without parsing.
@RhysSullivan
RhysSullivan force-pushed the artifact-url-in-inline-result branch from 901b3b6 to 62de5fb Compare July 30, 2026 17:31
@RhysSullivan
RhysSullivan merged commit 9bd4a5b into main Jul 30, 2026
@RhysSullivan RhysSullivan mentioned this pull request Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant