Skip to content

fix(skills): point a truncated description at invoke_skill, not the SKILL.md path - #6664

Merged
VascoSch92 merged 2 commits into
mainfrom
fix/skill-long-description-path
Nov 11, 2026
Merged

VascoSch92 merged 2 commits into
mainfrom
fix/skill-long-description-path

Conversation

@enyst

@enyst enyst commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

This PR proposes a fix for a bug uncovered during the first full agentic run of verify-sdk.


AGENT:

I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.

Requested by Engel · project thread

Decision needed

The load-time truncation notice used to name the skill's file on purpose (#2395, March), before invoke_skill existed. Since #2835 (April), to_prompt() leaves the location out so the agent loads skills through invoke_skill, and its tests say so (test_to_prompt_truncation_points_at_invoke_skill_not_source). The two behaviors conflict for any skill loaded from disk.

  • Implemented: the notice on Skill.description names the skill for invoke_skill and never the path. Two tests from fix: truncate long skill descriptions instead of raising errors (#2394) #2395 are updated to match.
  • Alternative: keep the path in Skill.description (for UIs or logs that show it) and have to_prompt() replace that notice with its own invoke_skill pointer. This keeps the path out of the prompt but leaves two different descriptions in play.

Why

Skill truncates a description over 1024 characters when SKILL.md is loaded, with ... You can view the complete skill content at /abs/path/.agents/skills/<name>/SKILL.md.. Because the truncated description is already within the limit, to_prompt() then adds nothing, so <available_skills> carried the absolute path and no invoke_skill pointer.

Summary

  • Skill._DESCRIPTION_TRUNCATE_NOTICE now reads ... Call invoke_skill(name="<name>") to load the full skill.; it is used with or without a source.
  • The field description and validator docstring say the same.
  • The verify-sdk note on S07.available-skills-prompt is updated.

Issue Number

Fixes #6644 (umbrella #6660)

How to Test

uv run pytest tests/sdk/skills tests/sdk/context -q
export PATH="$PWD/.agents/skills/verify-sdk/scripts:$PATH"
sdk-map run --file S07 --only S07.available-skills-prompt
  • New test test_loaded_long_description_points_at_invoke_skill_not_path loads a real SKILL.md with a 2000-character description and checks the prompt has the invoke_skill pointer and no path. It fails on main.
  • tests/sdk/skills and tests/sdk/context: 809 passed.
  • The map bullet passes: longdesc_points_to_invoke_skill true, longdesc_leaks_location false.

Video/Screenshots

Not applicable.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Cross-repo dependencies: none.


Generated by Claude Code


🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:26c3908-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-26c3908-python \
  ghcr.io/openhands/agent-server:26c3908-python

All tags pushed for this build

ghcr.io/openhands/agent-server:26c3908-golang-amd64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-golang-amd64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-golang-amd64
ghcr.io/openhands/agent-server:26c3908-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:26c3908-golang-arm64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-golang-arm64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-golang-arm64
ghcr.io/openhands/agent-server:26c3908-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:26c3908-java-amd64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-java-amd64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-java-amd64
ghcr.io/openhands/agent-server:26c3908-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:26c3908-java-arm64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-java-arm64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-java-arm64
ghcr.io/openhands/agent-server:26c3908-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:26c3908-python-amd64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-amd64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-amd64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-amd64
ghcr.io/openhands/agent-server:26c3908-python-arm64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-arm64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-arm64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-arm64
ghcr.io/openhands/agent-server:26c3908-python-minimal-amd64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-minimal-amd64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-minimal-amd64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:26c3908-python-minimal-arm64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-minimal-arm64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-minimal-arm64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:26c3908-python-slim-amd64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-slim-amd64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-slim-amd64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:26c3908-python-slim-arm64
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-slim-arm64
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-slim-arm64
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:26c3908-golang
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-golang
ghcr.io/openhands/agent-server:fix-skill-long-description-path-golang
ghcr.io/openhands/agent-server:26c3908-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:26c3908-java
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-java
ghcr.io/openhands/agent-server:fix-skill-long-description-path-java
ghcr.io/openhands/agent-server:26c3908-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:26c3908-python-minimal
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-minimal
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-minimal
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-minimal
ghcr.io/openhands/agent-server:26c3908-python-slim
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python-slim
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python-slim
ghcr.io/openhands/agent-server:26c3908-python-node-runtime-slim
ghcr.io/openhands/agent-server:26c3908-python
ghcr.io/openhands/agent-server:26c39084e981dd48c37ecc00637e1d2ab3354220-python
ghcr.io/openhands/agent-server:fix-skill-long-description-path-python
ghcr.io/openhands/agent-server:26c3908-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., 26c3908-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 26c3908-python-amd64) are also available if needed

…KILL.md path

Skill truncates a description over 1024 characters when it is loaded, and
its notice named the absolute path of the SKILL.md. to_prompt() leaves the
location out of <available_skills> on purpose so the agent loads skills
through invoke_skill, but the load-time notice put the path back and, being
within the limit already, kept to_prompt from adding its invoke_skill
pointer. The notice now names the skill for invoke_skill instead.

Fixes #6644

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/skills
   skill.py5522496%154–155, 333, 336–337, 346, 597, 666, 997–998, 1072–1073, 1248–1249, 1376, 1399, 1406–1407, 1457–1458, 1464–1465, 1471–1472
TOTAL55078856984% 

@datadog-official

This comment has been minimized.

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

Review summary

Reviewed at head 9c2494a4b488d3638b1ee39ee24c8e5ebff161cd. No material correctness, security, or compatibility findings.

Verified in the workspace:

  • Bug confirmed on main: loading a SKILL.md with a description over 1024 characters embeds the absolute SKILL.md path in Skill.description (load-time notice in _truncate_long_description). Because the truncated description already sits at exactly 1024 chars, to_prompt() adds nothing, so <available_skills> carried the path and no invoke_skill pointer — contradicting to_prompt()'s documented design (location deliberately omitted since #2835).
  • Fix is correct and consistent: _DESCRIPTION_TRUNCATE_NOTICE now names the skill for invoke_skill, matching the exact invoke_skill(name="<name>") wording already used by to_prompt()'s own truncation message and by AvailableSkillsSection ("the only supported way to invoke a skill"). The invoke_skill builtin matches skills by name, so the pointer resolves correctly. The fallback for a None/absent source is now the same pointer, which is strictly better than the old generic DEFAULT_TRUNCATE_NOTICE.
  • No consumer loses the path: Skill.source/SkillInfo.source are unchanged; the only runtime path disclosure (invoke_skill's location footer for bundled scripts//references/) still works and is intentionally scoped to post-invocation output. The legacy generic notice never contained a path either, so nothing depended on the removed behavior. Nested third-party skills (AGENTS.md/CLAUDE.md) never set a description, so they are unaffected.
  • Regression evidence: the new test test_loaded_long_description_points_at_invoke_skill_not_path exercises the real Skill.load() path (frontmatter → Pydantic validation, no mocks). I ran it against a detached main checkout — it fails there exactly as claimed (path in prompt, no invoke_skill pointer) — and it passes on this head.
  • Tests: uv run pytest tests/sdk/skills tests/sdk/context -q -> 809 passed on the head, matching the PR description. No tracked files were modified during review.
  • Compatibility: the field-description edit is metadata-only per the repo's API-breakage policy; no Field(default=...) change, no persisted-settings shape change, no REST/OpenAPI impact.

CI note (not a code finding): the "PR Description Check" on this head fails because umbrella issue #6660 (opened 2026-11-09) carries neither ready-for-dev nor a pre-rollout creation date; the direct fix target #6644 does have ready-for-dev. That is a process gate for the maintainer and does not reflect on the change itself.

✅ APPROVED

@all-hands-bot
all-hands-bot requested review from VascoSch92 and removed request for VascoSch92 November 9, 2026 09:33
@neubig
neubig requested a review from VascoSch92 November 9, 2026 18:17
@VascoSch92
VascoSch92 enabled auto-merge (squash) November 11, 2026 11:06
@VascoSch92
VascoSch92 merged commit 12c04f2 into main Nov 11, 2026
43 checks passed
@VascoSch92
VascoSch92 deleted the fix/skill-long-description-path branch November 11, 2026 11:16
@enyst enyst mentioned this pull request Nov 12, 2026
1 of 5 tasks
enyst added a commit that referenced this pull request Nov 12, 2026
- F25.long-description: a long skill description is cut with an
  invoke_skill pointer and no file path (#6664).
- F26.conversation-resume-disabled drives the MCP half: a disabled ambient
  plugin's MCP server is dropped on resume (#5756).
- F27.tool-schema-keywords: known bug #6766, reproduced through the server;
  F27 owns tool/schema.py; F27.import-modules uses LiteLLM's local cost map
  under env -i (#6749).
- F31.crash-tool-call checks recovery_reason and classification (#6778).
- F34.manager-batch-over-limit: the TypeScript client splits more than 99
  ids into batches (#6771).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwNZe7p1P7oMgnFNYcy
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.

[Bug]: A long skill description leaks the SKILL.md absolute path into the prompt instead of pointing to invoke_skill

4 participants