Skip to content

Commit ecde8ab

Browse files
committed
test(task): update parameter schema snapshot
1 parent 7970130 commit ecde8ab

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ exports[`tool parameters JSON Schema (wire shape) task 1`] = `
334334
{
335335
"$schema": "https://json-schema.org/draft/2020-12/schema",
336336
"properties": {
337+
"background": {
338+
"description": "When true, launch the subagent in the background and return immediately",
339+
"type": "boolean",
340+
},
337341
"command": {
338342
"description": "The command that triggered this task",
339343
"type": "string",
@@ -352,6 +356,7 @@ exports[`tool parameters JSON Schema (wire shape) task 1`] = `
352356
},
353357
"task_id": {
354358
"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)",
359+
"pattern": "^ses.*",
355360
"type": "string",
356361
},
357362
},

packages/opencode/test/tool/parameters.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,19 @@ describe("tool parameters", () => {
220220
const parsed = parse(Task, { description: "d", prompt: "p", subagent_type: "general" })
221221
expect(parsed.subagent_type).toBe("general")
222222
})
223+
test("accepts optional task_id + command + background", () => {
224+
const parsed = parse(Task, {
225+
description: "d",
226+
prompt: "p",
227+
subagent_type: "general",
228+
task_id: "ses_test",
229+
command: "/cmd",
230+
background: true,
231+
})
232+
expect(parsed.task_id).toBe("ses_test")
233+
expect(parsed.command).toBe("/cmd")
234+
expect(parsed.background).toBe(true)
235+
})
223236
test("rejects missing prompt", () => {
224237
expect(accepts(Task, { description: "d", subagent_type: "general" })).toBe(false)
225238
})

0 commit comments

Comments
 (0)