feat(babysitting): make unstable-agent-babysitter always-on by default
Remove the 'enabled' flag from babysitting config - the hook now runs automatically when not disabled via disabled_hooks. This simplifies configuration and makes the unstable model monitoring a default behavior. BREAKING CHANGE: babysitting.enabled config option is removed. Use disabled_hooks: ['unstable-agent-babysitter'] to disable the hook instead.
This commit is contained in:
parent
6080bc8caf
commit
b6da473341
@ -2924,10 +2924,6 @@
|
|||||||
"babysitting": {
|
"babysitting": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"enabled": {
|
|
||||||
"default": false,
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"timeout_ms": {
|
"timeout_ms": {
|
||||||
"default": 120000,
|
"default": 120000,
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
|||||||
@ -313,7 +313,6 @@ export const NotificationConfigSchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const BabysittingConfigSchema = z.object({
|
export const BabysittingConfigSchema = z.object({
|
||||||
enabled: z.boolean().default(false),
|
|
||||||
timeout_ms: z.number().default(120000),
|
timeout_ms: z.number().default(120000),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ describe("unstable-agent-babysitter hook", () => {
|
|||||||
const backgroundManager = createBackgroundManager([createTask()])
|
const backgroundManager = createBackgroundManager([createTask()])
|
||||||
const hook = createUnstableAgentBabysitterHook(ctx, {
|
const hook = createUnstableAgentBabysitterHook(ctx, {
|
||||||
backgroundManager,
|
backgroundManager,
|
||||||
config: { enabled: true, timeout_ms: 120000 },
|
config: { timeout_ms: 120000 },
|
||||||
})
|
})
|
||||||
|
|
||||||
// #when
|
// #when
|
||||||
@ -111,7 +111,7 @@ describe("unstable-agent-babysitter hook", () => {
|
|||||||
])
|
])
|
||||||
const hook = createUnstableAgentBabysitterHook(ctx, {
|
const hook = createUnstableAgentBabysitterHook(ctx, {
|
||||||
backgroundManager,
|
backgroundManager,
|
||||||
config: { enabled: true, timeout_ms: 120000 },
|
config: { timeout_ms: 120000 },
|
||||||
})
|
})
|
||||||
|
|
||||||
// #when
|
// #when
|
||||||
@ -139,7 +139,7 @@ describe("unstable-agent-babysitter hook", () => {
|
|||||||
])
|
])
|
||||||
const hook = createUnstableAgentBabysitterHook(ctx, {
|
const hook = createUnstableAgentBabysitterHook(ctx, {
|
||||||
backgroundManager,
|
backgroundManager,
|
||||||
config: { enabled: true, timeout_ms: 120000 },
|
config: { timeout_ms: 120000 },
|
||||||
})
|
})
|
||||||
|
|
||||||
// #when
|
// #when
|
||||||
@ -160,7 +160,7 @@ describe("unstable-agent-babysitter hook", () => {
|
|||||||
const backgroundManager = createBackgroundManager([createTask()])
|
const backgroundManager = createBackgroundManager([createTask()])
|
||||||
const hook = createUnstableAgentBabysitterHook(ctx, {
|
const hook = createUnstableAgentBabysitterHook(ctx, {
|
||||||
backgroundManager,
|
backgroundManager,
|
||||||
config: { enabled: true, timeout_ms: 120000 },
|
config: { timeout_ms: 120000 },
|
||||||
})
|
})
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
const originalNow = Date.now
|
const originalNow = Date.now
|
||||||
|
|||||||
@ -8,7 +8,6 @@ const COOLDOWN_MS = 5 * 60 * 1000
|
|||||||
const THINKING_SUMMARY_MAX_CHARS = 500
|
const THINKING_SUMMARY_MAX_CHARS = 500
|
||||||
|
|
||||||
type BabysittingConfig = {
|
type BabysittingConfig = {
|
||||||
enabled?: boolean
|
|
||||||
timeout_ms?: number
|
timeout_ms?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +186,6 @@ export function createUnstableAgentBabysitterHook(ctx: BabysitterContext, option
|
|||||||
|
|
||||||
const eventHandler = async ({ event }: { event: { type: string; properties?: unknown } }) => {
|
const eventHandler = async ({ event }: { event: { type: string; properties?: unknown } }) => {
|
||||||
if (event.type !== "session.idle") return
|
if (event.type !== "session.idle") return
|
||||||
if (options.config?.enabled !== true) return
|
|
||||||
|
|
||||||
const props = event.properties as Record<string, unknown> | undefined
|
const props = event.properties as Record<string, unknown> | undefined
|
||||||
const sessionID = props?.sessionID as string | undefined
|
const sessionID = props?.sessionID as string | undefined
|
||||||
|
|||||||
@ -291,8 +291,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
})
|
})
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const unstableAgentBabysitter =
|
const unstableAgentBabysitter = isHookEnabled("unstable-agent-babysitter")
|
||||||
isHookEnabled("unstable-agent-babysitter") && pluginConfig.babysitting?.enabled === true
|
|
||||||
? createUnstableAgentBabysitterHook(
|
? createUnstableAgentBabysitterHook(
|
||||||
{
|
{
|
||||||
directory: ctx.directory,
|
directory: ctx.directory,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user