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.
This commit is contained in:
YeonGyu-Kim
2026-02-14 14:30:30 +09:00
parent 43cadc95e8
commit a466c2e220
7 changed files with 37 additions and 12 deletions
@@ -2,6 +2,7 @@ import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types"
import type { ExecutorContext, ParentContext } from "./executor-types"
import { storeToolMetadata } from "../../features/tool-metadata-store"
import { formatDetailedError } from "./error-formatting"
import { getSessionTools } from "../../shared/session-tools-store"
export async function executeBackgroundContinuation(
args: DelegateTaskArgs,
@@ -19,6 +20,7 @@ export async function executeBackgroundContinuation(
parentMessageID: parentContext.messageID,
parentModel: parentContext.model,
parentAgent: parentContext.agent,
parentTools: getSessionTools(parentContext.sessionID),
})
const bgContMeta = {