refactor(background-task): remove session_id parameter, use toolContext
Session ID is now automatically detected from toolContext.sessionID 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -27,7 +27,6 @@ export function createBackgroundTask(manager: BackgroundManager) {
|
|||||||
description: tool.schema.string().describe("Short task description (shown in status)"),
|
description: tool.schema.string().describe("Short task description (shown in status)"),
|
||||||
prompt: tool.schema.string().describe("Full detailed prompt for the agent"),
|
prompt: tool.schema.string().describe("Full detailed prompt for the agent"),
|
||||||
agent: tool.schema.string().describe("Agent type to use (any agent allowed)"),
|
agent: tool.schema.string().describe("Agent type to use (any agent allowed)"),
|
||||||
session_id: tool.schema.string().describe("Parent session ID (auto-detected if omitted)").optional(),
|
|
||||||
},
|
},
|
||||||
async execute(args: BackgroundTaskArgs, toolContext) {
|
async execute(args: BackgroundTaskArgs, toolContext) {
|
||||||
try {
|
try {
|
||||||
@@ -35,8 +34,8 @@ export function createBackgroundTask(manager: BackgroundManager) {
|
|||||||
description: args.description,
|
description: args.description,
|
||||||
prompt: args.prompt,
|
prompt: args.prompt,
|
||||||
agent: args.agent,
|
agent: args.agent,
|
||||||
parentSessionID: args.session_id ?? toolContext.sessionID,
|
parentSessionID: toolContext.sessionID,
|
||||||
parentMessageID: toolContext.messageID ?? "unknown",
|
parentMessageID: toolContext.messageID,
|
||||||
})
|
})
|
||||||
|
|
||||||
return `✅ Background task launched successfully!
|
return `✅ Background task launched successfully!
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export interface BackgroundTaskArgs {
|
|||||||
description: string
|
description: string
|
||||||
prompt: string
|
prompt: string
|
||||||
agent: string
|
agent: string
|
||||||
session_id?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BackgroundStatusArgs {
|
export interface BackgroundStatusArgs {
|
||||||
|
|||||||
Reference in New Issue
Block a user