Skip to content

fix(core): hint when the skill tool is called with an agent name - #46940

Open
holny wants to merge 1 commit into
anomalyco:v2from
holny:skill-agent-hint
Open

fix(core): hint when the skill tool is called with an agent name#46940
holny wants to merge 1 commit into
anomalyco:v2from
holny:skill-agent-hint

Conversation

@holny

@holny holny commented Sep 3, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #46568

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When a model invokes the skill tool 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 existing permission.rejected classification from the tool boundary).

How did you verify your code works?

  • Extended 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 behavior
  • bun typecheck in packages/core and packages/ai
  • bun test in packages/core (no new failures; 3 pre-existing environment-dependent failures in git-worktree/pty tests reproduce on a clean baseline)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@holny

holny commented Sep 3, 2026

Copy link
Copy Markdown
Author

Fixes #46568 — the linked-issue check doesn't resolve the keyword from a fork PR, so referencing it here directly.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant