Repository navigation
fix(tools): Name the fix in model-facing tool error messages - #4058
Conversation
Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 418ceee. Configure here.
| throw new PluginToolInputError(`${name} is required`); | ||
| throw new PluginToolInputError( | ||
| `${name} must not be empty. Set it and call the tool again.`, | ||
| ); |
There was a problem hiding this comment.
Runtime fields get retry advice
Medium Severity
nonEmptyString now tells the model to set the empty field and retry, but it also validates runtime conversationId and toolCallId. Those values come from the Turn, not the tool arguments, so the new fix sends the model to retry a call it cannot repair.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 418ceee. Configure here.
There was a problem hiding this comment.
Agreed. One nonEmptyString helper checks both model fields (title, head, base, labels) and the runtime conversationId and toolCallId, so the retry advice is wrong for the runtime ids. This PR merged before I could change it. The fix belongs in a follow-up: give the runtime ids their own check with a "no change to the call can fix this" message, in both create-issue.ts and create-pull-request.ts.
There was a problem hiding this comment.
#4060 fixes this. In createIssue and createPullRequest, conversationId and toolCallId now get their own check, with a "no change to the call can fix this" message.
| if (!response.ok) { | ||
| throw new PluginToolInputError( | ||
| `GitHub repository lookup failed with HTTP ${response.status}`, | ||
| `GitHub repository lookup failed with HTTP ${response.status}. Check repo. If it is correct, the GitHub App cannot see the repository.`, |
There was a problem hiding this comment.
Repo lookup blames visibility always
Low Severity
getRepository now appends “Check repo. If it is correct, the GitHub App cannot see the repository.” to every non-OK response. getIssue and getPullRequest only add that text on HTTP 404, so 401/5xx lookups are described as a visibility miss when they are not.
Reviewed by Cursor Bugbot for commit 418ceee. Configure here.
There was a problem hiding this comment.
Agreed. getRepository throws the repairable error for every non-OK status, and it now adds the visibility hint to all of them. The hint is right only for 404. This PR merged before I could change it. A follow-up should add the hint only on 404, as getIssue and getPullRequest do, and treat other statuses as system errors.
There was a problem hiding this comment.
#4060 fixes this. getRepository now adds the visibility hint only on 404. Other statuses throw a system error, as in getIssue and getPullRequest.


Applies the tool error rule from the design docs in #4050: an error that the model can fix says what was wrong and how to fix it. That means the argument and the form that it takes, the tool that finds the right value, or that no change to the call can work in this Turn.
Many
ToolInputError/PluginToolInputErrormessages only said what failed, such as "Automation was not found.", "edits is required", or "Attachment not found in this conversation." The model then guessed, retried the same call, or gave up. This PR adds the missing fix to those messages in core and in the GitHub, Google, and Vercel plugins. Messages that already named a fix stay as they are.Examples:
Automation was not found.→Automation was not found. Use searchAutomations to find its id. …edits is required→edits is required. Set edits to a list of { old_text, new_text } replacements.Slack workspace is unavailable.→The Slack workspace of this Conversation is unknown. Set destination to "current_conversation", or ask from the Slack channel where the automation should deliver.ttl_ms must be a positive finite number→ttl_ms must be a positive number of milliseconds. Leave it out to use the default.Check repo and issue, and fix any field that GitHub names., with the fields of that tool.Each tool or field that a message names exists in the context where the error is thrown. Where the runtime or a person has to act, such as a missing Turn or tool call id, an unlinked User, or a missing Slack scope, the message says that no change to the call can fix it.
A few upstream message sources that reach the model through these throw sites got the same treatment: the Slack channel-access denials, the
ScheduleIntentErrormessages, and the public-search scope errors. Inevent-automations/tool-support.ts, a message that namedresourceTypenow uses the schema fieldresource_type.Error classes, control flow, schemas, plain
Errorthrows, and thetool-error-classificationbaseline are unchanged. Tests that asserted the exact old strings are updated.via @dcramer.
--
View Session [Sentry]