diff --git a/src/tools/background-task/tools.ts b/src/tools/background-task/tools.ts index 57236ff..98eba74 100644 --- a/src/tools/background-task/tools.ts +++ b/src/tools/background-task/tools.ts @@ -211,12 +211,7 @@ export function createBackgroundOutput(manager: BackgroundManager, client: Openc const shouldBlock = args.block === true const timeoutMs = Math.min(args.timeout ?? 60000, 600000) - // Non-blocking: return status immediately - if (!shouldBlock) { - return formatTaskStatus(task) - } - - // Already completed: return result immediately + // Already completed: return result immediately (regardless of block flag) if (task.status === "completed") { return await formatTaskResult(task, client) } @@ -226,6 +221,11 @@ export function createBackgroundOutput(manager: BackgroundManager, client: Openc return formatTaskStatus(task) } + // Non-blocking and still running: return status + if (!shouldBlock) { + return formatTaskStatus(task) + } + // Blocking: poll until completion or timeout const startTime = Date.now() diff --git a/src/tools/call-omo-agent/tools.ts b/src/tools/call-omo-agent/tools.ts index e423fb6..570042b 100644 --- a/src/tools/call-omo-agent/tools.ts +++ b/src/tools/call-omo-agent/tools.ts @@ -67,9 +67,10 @@ Description: ${task.description} Agent: ${task.agent} (subagent) Status: ${task.status} -Use \`background_output\` tool with task_id="${task.id}" to check progress or retrieve results. -- block=false: Check status without waiting -- block=true (default): Wait for completion and get result` +The system will notify you when the task completes. +Use \`background_output\` tool with task_id="${task.id}" to check progress: +- block=false (default): Check status immediately - returns full status info +- block=true: Wait for completion (rarely needed since system notifies)` } catch (error) { const message = error instanceof Error ? error.message : String(error) return `Failed to launch background agent task: ${message}`