Files
magpie/internal/gateway/testdata/claude-code-skill-launch.json
T
yetone 5506c84437 gateway: a skill's body reaches the run with its Skill call's result
Claude Code answers a Skill call with "Launching skill: <name>" and sends
the skill's SKILL.md after the results, as a text block headed "Base
directory for this skill: …". Since d84f58fd2 (#5403) that text counts
as the agent's own (desktopNote), so it is no longer said to the run as
the user's, which was right, but nothing handed it to the run either:
on the Claude subscription route a model that launched a skill saw
"Launching skill: pdf" and never what the skill says. Every skill
launched through magpie's Claude subscription lost its body.

withSkillBodies appends each such body to its Skill call's result (two
skills at once each get their own), else to the result it follows, else
to the last; saidWithResults still leaves it out of the user's words.

Found with a real Claude Code 2.1.316 in a sandbox HOME against the live
gateway: a proxy between them showed the body in the request, and the
model answered as if it had none.

Run (mote, at this tree):
- go test -tags nogui ./internal/gateway -run
  'SkillBod|Desktop|TaskNotice|SaidWith|MidTurn|Notice' -count=1: ok.
- TestSkillBodyRealClaudeCode parses the request Claude Code sent
  (testdata/claude-code-skill-launch.json: its own bytes, trimmed to the
  launch turn, paths shortened) and checks what the run is handed.
- Broken by hand (withSkillBodies returning results as they came):
  TestSkillBodyReachesTheSkillResult and TestSkillBodiesTwoSkills red.
- go test -tags nogui ./internal/gateway -count=1 -timeout 45m: ok
  (1220.8s), at origin/main 6b0b7a96e. Rebased on 8f74442e4, whose
  gateway change is browser.go: -run
  'SkillBod|Browser|ClaudeSub|TaskNotice' ok.

Not tried: a real run through a gateway built from this tree (the
Claude subscription's sign-in would be refreshed by a sandbox copy).

docs/subsystems/claude-subscription-bridge.md says what withSkillBodies
does, beside withTaskNotices.
2026-11-09 08:38:02 +08:00

46 lines
1.4 KiB
JSON

{
"model": "claude-opus-5-5",
"max_tokens": 128000,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Call the Skill tool with magpie-skills, then say DONE."
}
]
},
{
"role": "assistant",
"content": [
{
"id": "toolu_01Ki4FUUEBT8M4Ai6KnsB5Jt",
"input": {
"skill": "magpie-skills"
},
"name": "Skill",
"type": "tool_use"
}
]
},
{
"role": "user",
"content": [
{
"type": "tool_result",
"tool_use_id": "toolu_01Ki4FUUEBT8M4Ai6KnsB5Jt",
"content": "Launching skill: magpie-skills"
},
{
"type": "text",
"text": "Base directory for this skill: /Users/u/.claude/skills/magpie-skills\n\n# The user's skills\n\nEach skill below is a folder with a SKILL.md of instructions, often with scripts or templates beside it. When the task fits a skill, open its SKILL.md with the Read tool at the exact path given (it is there, so don't search for it), then do what it says. A file or script it names is in the same folder as that SKILL.md.\n\n## greet-user\n\nGreet the user by name. Use when the user asks to be greeted.\n\nRead: `/Users/u/.claude/skills/magpie-skills/.skills/greet-user/SKILL.md`\n\n## pirate-voice\n\nTalk like a pirate. Use when asked for pirate speech.\n\nRead: `/Users/u/.claude/skills/magpie-skills/.skills/pirate-voice/SKILL.md`\n",
"cache_control": {
"type": "ephemeral"
}
}
]
}
]
}