feat(sisyphus-task): make skills parameter required

- Add validation for skills parameter (must be provided, use [] if empty)
- Update schema to remove .optional()
- Update type definition to make skills non-optional
- Fix existing tests to include skills parameter
This commit is contained in:
YeonGyu-Kim
2026-01-08 14:36:15 +09:00
parent 64b9b4d36a
commit 0d0bf4d384
3 changed files with 52 additions and 5 deletions
+5 -2
View File
@@ -121,17 +121,20 @@ export function createSisyphusTask(options: SisyphusTaskToolOptions): ToolDefini
subagent_type: tool.schema.string().optional().describe("Agent name directly (e.g., 'oracle', 'explore'). Mutually exclusive with category."),
run_in_background: tool.schema.boolean().describe("Run in background. MUST be explicitly set. Use false for task delegation, true only for parallel exploration."),
resume: tool.schema.string().optional().describe("Session ID to resume - continues previous agent session with full context"),
skills: tool.schema.array(tool.schema.string()).optional().describe("Array of skill names to prepend to the prompt. Skills will be resolved and their content prepended with a separator."),
skills: tool.schema.array(tool.schema.string()).describe("Array of skill names to prepend to the prompt. Use [] if no skills needed."),
},
async execute(args: SisyphusTaskArgs, toolContext) {
const ctx = toolContext as ToolContextWithMetadata
if (args.run_in_background === undefined) {
return `❌ Invalid arguments: 'run_in_background' parameter is REQUIRED. Use run_in_background=false for task delegation, run_in_background=true only for parallel exploration.`
}
if (args.skills === undefined) {
return `❌ Invalid arguments: 'skills' parameter is REQUIRED. Use skills=[] if no skills needed.`
}
const runInBackground = args.run_in_background === true
let skillContent: string | undefined
if (args.skills && args.skills.length > 0) {
if (args.skills.length > 0) {
const { resolved, notFound } = resolveMultipleSkills(args.skills)
if (notFound.length > 0) {
const available = createBuiltinSkills().map(s => s.name).join(", ")