fix: hide task background instructions by default (#27872)

This commit is contained in:
Shoubhit Dash
2026-05-16 19:18:15 +05:30
committed by GitHub
parent 321db7a819
commit 68af95390d
2 changed files with 13 additions and 6 deletions

View File

@@ -24,6 +24,14 @@ export interface TaskPromptOps {
}
const id = "task"
const BACKGROUND_DESCRIPTION = [
"",
"",
[
"Background mode: background=true launches the subagent asynchronously.",
"Use task_status(task_id=..., wait=false) to poll, or wait=true to block until done.",
].join(" "),
].join("\n")
const BaseParameters = Schema.Struct({
description: Schema.String.annotate({ description: "A short (3-5 words) description of the task" }),
@@ -327,7 +335,7 @@ export const TaskTool = Tool.define(
})
return {
description: DESCRIPTION,
description: flags.experimentalBackgroundSubagents ? DESCRIPTION + BACKGROUND_DESCRIPTION : DESCRIPTION,
parameters: Parameters,
jsonSchema: flags.experimentalBackgroundSubagents ? undefined : ToolJsonSchema.fromSchema(BaseParameters),
execute: (params: Schema.Schema.Type<typeof Parameters>, ctx: Tool.Context) =>