diff --git a/src/features/team-mode/tools/messaging.ts b/src/features/team-mode/tools/messaging.ts index d18791a14..3c95a8b5a 100644 --- a/src/features/team-mode/tools/messaging.ts +++ b/src/features/team-mode/tools/messaging.ts @@ -4,7 +4,7 @@ import { type ToolDefinition, tool } from "@opencode-ai/plugin/tool" import { z } from "zod" import type { TeamModeConfig } from "../../../config/schema/team-mode" -import { promptAsyncAfterSessionIdle } from "../../../hooks/shared/prompt-async-gate" +import { dispatchInternalPrompt } from "../../../hooks/shared/prompt-async-gate" import { log } from "../../../shared/logger" import { applyMemberSessionRouting, buildMemberPromptBody } from "../member-session-routing" import { buildEnvelope } from "../team-mailbox/poll" @@ -199,7 +199,8 @@ async function deliverLive( applyMemberSessionRouting(recipientSessionId, recipientMember) try { - const promptResult = await promptAsyncAfterSessionIdle({ + const promptResult = await dispatchInternalPrompt({ + mode: "async", client, sessionID: recipientSessionId, source: "team-live-delivery", diff --git a/src/tools/call-omo-agent/sync-executor.ts b/src/tools/call-omo-agent/sync-executor.ts index 98d698fde..5459e0ee7 100644 --- a/src/tools/call-omo-agent/sync-executor.ts +++ b/src/tools/call-omo-agent/sync-executor.ts @@ -1,6 +1,6 @@ import type { PluginInput } from "@opencode-ai/plugin" import { clearSessionAgent, setSessionAgent, subagentSessions, syncSubagentSessions } from "../../features/claude-code-session-state" -import { promptAsyncAfterSessionIdle } from "../../hooks/shared/prompt-async-gate" +import { dispatchInternalPrompt } from "../../hooks/shared/prompt-async-gate" import { getAgentToolRestrictions, log } from "../../shared" import { getAgentDisplayName, stripAgentListSortPrefix } from "../../shared/agent-display-names" import { @@ -134,7 +134,8 @@ export async function executeSync( return `Error: Failed to send prompt: promptAsync is not available on this OpenCode client.\n\n\nsession_id: ${sessionID}\n` } - const promptResult = await promptAsyncAfterSessionIdle({ + const promptResult = await dispatchInternalPrompt({ + mode: "async", client: ctx.client, sessionID, source: "call-omo-agent:sync",