Skip to content

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

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

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
Contributor

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
Contributor Author

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

@holny

holny commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Nudge on this one as well — small fix, checks green, and the agent-hint path is covered by a test. Let me know if anything needs rework.

@holny

holny commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Second nudge here — it's a small change with a test and the agent-hint path is well covered. Happy to adjust anything or rebase if that helps.

@holny holny closed this by deleting the head repository Sep 9, 2026
@holny

holny commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #48159 - this PR's head fork was accidentally deleted on 2026-09-09 (not intentional); re-filed so the review can continue. Sorry for the noise.

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