From ba7baf72142350e66127fc2addcffd67db0a54f5 Mon Sep 17 00:00:00 2001 From: OgPenguu Date: Wed, 26 Aug 2026 20:43:18 +0300 Subject: [PATCH] fix: always include background parameter in task tool schema When OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true, the jsonSchema field was set to undefined, hiding the background parameter from the tool schema. Agents couldn't see the parameter and never used it. Changed from: jsonSchema: flags.experimentalBackgroundSubagents ? undefined : ToolJsonSchema.fromSchema(BaseParameters) To: jsonSchema: ToolJsonSchema.fromSchema(Parameters) This always includes the full Parameters schema (which has the background field) regardless of the experimental flag. The flag still controls the description hint and the execute function behavior. Co-authored-by: OpenChamber --- packages/opencode/src/tool/task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/tool/task.ts b/packages/opencode/src/tool/task.ts index d8ca640cfba9..45819692521e 100644 --- a/packages/opencode/src/tool/task.ts +++ b/packages/opencode/src/tool/task.ts @@ -363,7 +363,7 @@ export const TaskTool = Tool.define( ? [DESCRIPTION, BACKGROUND_DESCRIPTION].join("\n\n") : DESCRIPTION, parameters: Parameters, - jsonSchema: flags.experimentalBackgroundSubagents ? undefined : ToolJsonSchema.fromSchema(BaseParameters), + jsonSchema: ToolJsonSchema.fromSchema(Parameters), execute: (params: Schema.Schema.Type, ctx: Tool.Context) => run(params, ctx).pipe(Effect.orDie), }