mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-16 20:01:59 +00:00
test(task): update parameter schema snapshot
This commit is contained in:
parent
7970130720
commit
ecde8ab363
2 changed files with 18 additions and 0 deletions
|
|
@ -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",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue