Files
oh-my-opencode/src/features/background-agent/spawner/task-factory.ts
T
YeonGyu-Kim 8514906c3d fix: inherit parent session tool restrictions in background task notifications
Pass parentTools from session-tools-store through the background task
lifecycle (launch → task → notify) so that when notifyParentSession
sends promptAsync, the original tool restrictions (e.g., question: false)
are preserved. This prevents the Question tool from re-enabling after
call_omo_agent background tasks complete.
2026-02-14 14:58:25 +09:00

20 lines
576 B
TypeScript

import { randomUUID } from "crypto"
import type { BackgroundTask, LaunchInput } from "../types"
export function createTask(input: LaunchInput): BackgroundTask {
return {
id: `bg_${randomUUID().slice(0, 8)}`,
status: "pending",
queuedAt: new Date(),
description: input.description,
prompt: input.prompt,
agent: input.agent,
parentSessionID: input.parentSessionID,
parentMessageID: input.parentMessageID,
parentModel: input.parentModel,
parentAgent: input.parentAgent,
parentTools: input.parentTools,
model: input.model,
}
}