test(task): update parameter schema snapshot

This commit is contained in:
Shoubhit Dash 2026-04-24 20:20:04 +05:30
parent 7970130720
commit ecde8ab363
2 changed files with 18 additions and 0 deletions

View file

@ -334,6 +334,10 @@ exports[`tool parameters JSON Schema (wire shape) task 1`] = `
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"background": {
"description": "When true, launch the subagent in the background and return immediately",
"type": "boolean",
},
"command": {
"description": "The command that triggered this task",
"type": "string",
@ -352,6 +356,7 @@ exports[`tool parameters JSON Schema (wire shape) task 1`] = `
},
"task_id": {
"description": "This should only be set if you mean to resume a previous task (you can pass a prior task_id and the task will continue the same subagent session as before instead of creating a fresh one)",
"pattern": "^ses.*",
"type": "string",
},
},

View file

@ -220,6 +220,19 @@ describe("tool parameters", () => {
const parsed = parse(Task, { description: "d", prompt: "p", subagent_type: "general" })
expect(parsed.subagent_type).toBe("general")
})
test("accepts optional task_id + command + background", () => {
const parsed = parse(Task, {
description: "d",
prompt: "p",
subagent_type: "general",
task_id: "ses_test",
command: "/cmd",
background: true,
})
expect(parsed.task_id).toBe("ses_test")
expect(parsed.command).toBe("/cmd")
expect(parsed.background).toBe(true)
})
test("rejects missing prompt", () => {
expect(accepts(Task, { description: "d", subagent_type: "general" })).toBe(false)
})