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)"),
|
||||
prompt: tool.schema.string().describe("Full detailed prompt for the agent"),
|
||||
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) {
|
||||
try {
|
||||
@@ -35,8 +34,8 @@ export function createBackgroundTask(manager: BackgroundManager) {
|
||||
description: args.description,
|
||||
prompt: args.prompt,
|
||||
agent: args.agent,
|
||||
parentSessionID: args.session_id ?? toolContext.sessionID,
|
||||
parentMessageID: toolContext.messageID ?? "unknown",
|
||||
parentSessionID: toolContext.sessionID,
|
||||
parentMessageID: toolContext.messageID,
|
||||
})
|
||||
|
||||
return `✅ Background task launched successfully!
|
||||
|
||||
@@ -2,7 +2,6 @@ export interface BackgroundTaskArgs {
|
||||
description: string
|
||||
prompt: string
|
||||
agent: string
|
||||
session_id?: string
|
||||
}
|
||||
|
||||
export interface BackgroundStatusArgs {
|
||||
|
||||
Reference in New Issue
Block a user