fix: do not render views for failed tool calls - #1041
Closed
fredericbarthelet wants to merge 1 commit into
Closed
Conversation
A tool returning isError still carried a viewUUID, so hosts (playground, DevTools) rendered an empty view on top of the error. Skip the viewUUID on error results and mirror the host behavior in DevTools. Refs modelcontextprotocol/ext-apps#694 Co-authored-by: Frédéric Barthelet <fredericbarthelet@users.noreply.github.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A view tool that returns
isError: truestill produced a result carrying_meta.viewUUID. Hosts key view rendering off that marker, so the playground (ALP-1535) and DevTools (SKY-465) rendered an empty view on top of the error text — see the empty map in the linked issue.ext-apps#694 states hosts should not render the app view when a tool call fails.
Changes
packages/core:decorateToolHandlerno longer attachesviewUUIDwhen the handler returnsisError: true. A handler that throws was already unaffected — the SDK builds the error result itself, without our_meta.packages/devtools: the tool panel treats an errored result as "no view": it shows the tool output JSON with theErrorbadge, plus a short note explaining why the view is not rendered (hosts behave the same way).api-reference/register-tool) and the app-builder skill reference now say the failure belongs incontent, since the view is skipped.DevTools running the new
error-cardfixture tool — no iframe, error output, and noviewUUIDin the response:Tests
packages/core/src/test/view.test.ts: an error result keeps its own_metabut gets noviewUUID.e2e/tests/tool-error.spec.ts) with anerror-cardfixture tool: the iframe is absent, the error text and the notice are visible. Verified it fails without the DevTools change.pnpm test,pnpm build, and the full DevTools e2e suite pass.Linear Issue: ALP-1535