fix(core): hint when the skill tool is called with an agent name - #46940
Open
holny wants to merge 1 commit into
Open
fix(core): hint when the skill tool is called with an agent name#46940holny wants to merge 1 commit into
holny wants to merge 1 commit into
Conversation
The skill tool collapsed every load failure into the same opaque message, so a model invoking it with a subagent's name got "Unable to load skill" and wandered into a manual debugging loop. When the id resolves in the agent registry, fail with a hint that it is an agent and should be prompted as a subagent; unknown-skill and permission failures stay distinct.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Author
|
Fixes #46568 — the linked-issue check doesn't resolve the keyword from a fork PR, so referencing it here directly. |
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.
Issue for this PR
Fixes #46568
Type of change
What does this PR do?
When a model invokes the
skilltool with a subagent's name, the tool failed with the same opaque "Unable to load skill" message as an unknown skill, sending the conversation into a manual debugging loop. Now the tool resolves the id against the agent registry on a miss: if it matches an agent, the failure says so and points the model at prompting the subagent instead. Unknown-skill and permission failures stay distinct (permission rejections keep their existingpermission.rejectedclassification from the tool boundary).How did you verify your code works?
test/tool-skill.test.ts: invoking the skill tool with an agent id now fails with the agent hint, while the unknown-skill and permission-denied cases keep their existing behaviorbun typecheckinpackages/coreandpackages/aibun testinpackages/core(no new failures; 3 pre-existing environment-dependent failures in git-worktree/pty tests reproduce on a clean baseline)Checklist