fix(gsd): use explicit parameter syntax in skill activation prompts
The skill activation block used positional-looking syntax
`Call Skill('name')` which caused LLMs (especially non-Anthropic
models) to pass `{name: "..."}` instead of the required
`{skill: "..."}` parameter. This triggered tool validation failures
and stuck dispatch loops in auto-mode.
Change the prompt template to `Call Skill({ skill: 'name' })` which
makes the parameter name explicit and matches the Skill tool schema.
Update all 4 affected test assertions to match the new format.
Closes #2224
This commit is contained in:
parent
419a74672e
commit
006184456a
2 changed files with 7 additions and 5 deletions
|
|
@ -421,7 +421,9 @@ function resolvePreferredSkillNames(
|
|||
|
||||
function formatSkillActivationBlock(skillNames: string[]): string {
|
||||
if (skillNames.length === 0) return "";
|
||||
const calls = skillNames.map(name => `Call Skill('${name}')`).join('. ');
|
||||
// Use explicit parameter syntax so LLMs pass { skill: "..." } instead of { name: "..." }.
|
||||
// Positional-looking `Skill('name')` caused validation failures — see #2224.
|
||||
const calls = skillNames.map(name => `Call Skill({ skill: '${name}' })`).join('. ');
|
||||
return `<skill_activation>${calls}.</skill_activation>`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ test("buildSkillActivationBlock activates skills via prefer_skills when context
|
|||
prefer_skills: ["react"],
|
||||
});
|
||||
|
||||
assert.match(result, /Call Skill\('react'\)/);
|
||||
assert.match(result, /Call Skill\(\{ skill: 'react' \}\)/);
|
||||
assert.doesNotMatch(result, /swiftui/);
|
||||
} finally {
|
||||
cleanup(base);
|
||||
|
|
@ -92,7 +92,7 @@ test("buildSkillActivationBlock includes always_use_skills from preferences usin
|
|||
always_use_skills: ["swift-testing"],
|
||||
});
|
||||
|
||||
assert.equal(result, "<skill_activation>Call Skill('swift-testing').</skill_activation>");
|
||||
assert.equal(result, "<skill_activation>Call Skill({ skill: 'swift-testing' }).</skill_activation>");
|
||||
} finally {
|
||||
cleanup(base);
|
||||
}
|
||||
|
|
@ -120,8 +120,8 @@ test("buildSkillActivationBlock includes skill_rules matches and task-plan skill
|
|||
skill_rules: [{ when: "prisma database schema", use: ["prisma"] }],
|
||||
});
|
||||
|
||||
assert.match(result, /Call Skill\('accessibility'\)/);
|
||||
assert.match(result, /Call Skill\('prisma'\)/);
|
||||
assert.match(result, /Call Skill\(\{ skill: 'accessibility' \}\)/);
|
||||
assert.match(result, /Call Skill\(\{ skill: 'prisma' \}\)/);
|
||||
} finally {
|
||||
cleanup(base);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue