fix(babysitter): avoid double prompt gate

This commit is contained in:
YeonGyu-Kim
2026-05-19 13:48:55 +09:00
parent 44ef5dec1d
commit bb75751410
3 changed files with 92 additions and 25 deletions
+2 -25
View File
@@ -3,7 +3,6 @@ import type { PluginContext } from "./types"
import { createUnstableAgentBabysitterHook } from "../hooks"
import type { BackgroundManager } from "../features/background-agent"
import { dispatchInternalPrompt } from "../hooks/shared/prompt-async-gate"
export function createUnstableAgentBabysitter(args: {
ctx: PluginContext
@@ -26,30 +25,8 @@ export function createUnstableAgentBabysitter(args: {
return []
},
status: async () => ctx.client.session.status(),
prompt: async (promptArgs) => {
const promptResult = await dispatchInternalPrompt({
mode: "async",
client: ctx.client,
sessionID: promptArgs.path.id,
source: "unstable-agent-babysitter",
input: promptArgs,
})
if (promptResult.status === "failed") {
throw promptResult.error
}
},
promptAsync: async (promptArgs) => {
const promptResult = await dispatchInternalPrompt({
mode: "async",
client: ctx.client,
sessionID: promptArgs.path.id,
source: "unstable-agent-babysitter",
input: promptArgs,
})
if (promptResult.status === "failed") {
throw promptResult.error
}
},
prompt: async (promptArgs) => ctx.client.session.prompt(promptArgs),
promptAsync: async (promptArgs) => ctx.client.session.promptAsync(promptArgs),
},
},
},