Repository navigation
Surface a client tool's error when it returns no content - #330709
Closed
Ryan Ewen (RyanEwen) wants to merge 2 commits into
Closed
Ryan Ewen (RyanEwen) wants to merge 2 commits into
Ryan Ewen (RyanEwen) wants to merge 2 commits into
Conversation
A client tool can report a failure as an `error` alone with no content:
the workbench builds exactly that shape whenever the tool throws, so a
browser call that fails to navigate arrives as
`{success: false, error: {message}}` and nothing else.
`convertToolCallResult` read only `content`, so that became
`{content: [], isError: true}`. The model was handed an empty tool
result with no indication of what went wrong, and the reason for the
failure was dropped on the floor.
Use the error message as the content when the tool supplied none. Tools
that already describe the failure in `content` keep their own, so no
message is duplicated.
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Surfaces client-tool error messages to Claude when no result content exists.
Changes:
- Converts error-only failures into text content.
- Preserves existing tool-provided content.
- Adds regression coverage for both cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
claudeClientToolResult.ts |
Adds error-message fallback content. |
claudeClientToolResult.test.ts |
Tests fallback and content preservation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
A client tool can report a failure as an
erroralone, with no content. The workbench builds exactly that shape whenever a client tool throws, so a browser call that cannot navigate arrives as:{"success": false, "pastTenseMessage": "openBrowserPage failed", "error": {"message": "page.goto: net::ERR_EMPTY_RESPONSE at http://localhost:5173/…"}}convertToolCallResultreads onlycontent, so this becomes{content: [], isError: true}. The model gets an empty tool result: it is told something failed but not what, and the actual reason is dropped.Observed live in a dev container: the browser tool failed because the dev server was not listening, and the agent received nothing to act on.
This uses the error message as the content when the tool supplied none. Tools that already describe the failure in
content(viaerrorResult) keep their own, so nothing is duplicated.Testing
an error-only failure surfaces the message as content instead of an empty result, asserting both directions in one snapshot: the error-only result gains the message, and a result that already carries content is left untouched../scripts/test.sh --grep convertToolCallResult: 7 passing../scripts/test.sh --grep ClaudeAgent: 265 passing, 3 failing, the same 3 failing on an unmodified checkout (model catalog / credential tests, unrelated).npm run typecheck-clientclean.AI disclosure: this description and the code it proposes were written with the assistance of AI.
Public patches and patcher scripts
Source patch and installed-bundle workaround mapping. The public collection includes the maintained patchers, rollback instructions, regression scripts, and historical snapshots. Build restrictions and exact installer coverage are documented there.