Skip to content

fix(options): auto-inject Skill tool when skills option is set with explicit tools#979

Open
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-977
Open

fix(options): auto-inject Skill tool when skills option is set with explicit tools#979
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-977

Conversation

@anishesg
Copy link
Copy Markdown

When skills="all" or a skill list is set alongside an explicit tools list in AgentOptions, the SDK was not automatically injecting the "Skill" tool into the base tools list. This caused the agent to be unable to invoke skills because the Skill tool wasn't available, even though it was configured in allowed_tools.

The root cause was in subprocess_cli.py where the tools list was processed before skills handling. When users explicitly set tools=["WebSearch", "WebFetch", "Read"], the Skill tool was added to allowed_tools but not to the base tools list, making it allowed but unavailable.

The fix adds logic in the _build_command method to automatically append "Skill" to the tools list when skills is set and an explicit tools list is provided. This ensures skills work correctly regardless of whether tools are explicitly configured or not.

Three regression tests have been added to cover:

  • skills="all" with explicit tools list
  • skills=["name"] with explicit tools list
  • Idempotency when "Skill" is already in the tools list

Fixes #977

…xplicit tools

When `skills="all"` or a skill list is set alongside an explicit `tools` list in Options, the SDK was not automatically injecting the "Skill" tool into the base tools list. This caused the system to be unable to invoke skills because the Skill tool wasn't available, even though it was configured in allowed_tools.

Signed-off-by: anish <anishesg@users.noreply.github.com>
@anishesg anishesg marked this pull request as ready for review May 20, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills="all" does not add "Skill" to tools

1 participant