fix(babysitter): gate reminder prompts
This commit is contained in:
@@ -3,6 +3,7 @@ import type { PluginContext } from "./types"
|
||||
|
||||
import { createUnstableAgentBabysitterHook } from "../hooks"
|
||||
import type { BackgroundManager } from "../features/background-agent"
|
||||
import { promptAsyncAfterSessionIdle } from "../hooks/shared/prompt-async-gate"
|
||||
|
||||
export function createUnstableAgentBabysitter(args: {
|
||||
ctx: PluginContext
|
||||
@@ -24,11 +25,28 @@ export function createUnstableAgentBabysitter(args: {
|
||||
}
|
||||
return []
|
||||
},
|
||||
status: async () => ctx.client.session.status(),
|
||||
prompt: async (promptArgs) => {
|
||||
await ctx.client.session.promptAsync(promptArgs)
|
||||
const promptResult = await promptAsyncAfterSessionIdle({
|
||||
client: ctx.client,
|
||||
sessionID: promptArgs.path.id,
|
||||
source: "unstable-agent-babysitter",
|
||||
input: promptArgs,
|
||||
})
|
||||
if (promptResult.status === "failed") {
|
||||
throw promptResult.error
|
||||
}
|
||||
},
|
||||
promptAsync: async (promptArgs) => {
|
||||
await ctx.client.session.promptAsync(promptArgs)
|
||||
const promptResult = await promptAsyncAfterSessionIdle({
|
||||
client: ctx.client,
|
||||
sessionID: promptArgs.path.id,
|
||||
source: "unstable-agent-babysitter",
|
||||
input: promptArgs,
|
||||
})
|
||||
if (promptResult.status === "failed") {
|
||||
throw promptResult.error
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user