fix(#2732): detect crashed subagent sessions with shorter timeout
When a subagent session disappears from the status registry (process crashed), the main agent was waiting the full stale timeout before acting. Fix: - Add sessionGoneTimeoutMs config option (default 60s, vs 30min normal) - task-poller: use shorter timeout when session is gone from status - manager: verify session existence when gone, fail crashed tasks immediately with descriptive error - Add legacy-plugin-toast hook for #2823 migration warnings - Update schema with new config option
This commit is contained in:
@@ -195,6 +195,7 @@ export function createEventHandler(args: {
|
||||
|
||||
const dispatchToHooks = async (input: EventInput): Promise<void> => {
|
||||
await Promise.resolve(hooks.autoUpdateChecker?.event?.(input));
|
||||
await Promise.resolve(hooks.legacyPluginToast?.event?.(input));
|
||||
await Promise.resolve(hooks.claudeCodeHooks?.event?.(input));
|
||||
await Promise.resolve(hooks.backgroundNotificationHook?.event?.(input));
|
||||
await Promise.resolve(hooks.sessionNotification?.(input));
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
createQuestionLabelTruncatorHook,
|
||||
createPreemptiveCompactionHook,
|
||||
createRuntimeFallbackHook,
|
||||
createLegacyPluginToastHook,
|
||||
} from "../../hooks"
|
||||
import { createAnthropicEffortHook } from "../../hooks/anthropic-effort"
|
||||
import {
|
||||
@@ -60,6 +61,7 @@ export type SessionHooks = {
|
||||
taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null
|
||||
anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null
|
||||
runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null
|
||||
legacyPluginToast: ReturnType<typeof createLegacyPluginToastHook> | null
|
||||
}
|
||||
|
||||
export function createSessionHooks(args: {
|
||||
@@ -262,6 +264,11 @@ export function createSessionHooks(args: {
|
||||
pluginConfig,
|
||||
}))
|
||||
: null
|
||||
|
||||
const legacyPluginToast = isHookEnabled("legacy-plugin-toast")
|
||||
? safeHook("legacy-plugin-toast", () => createLegacyPluginToastHook(ctx))
|
||||
: null
|
||||
|
||||
return {
|
||||
contextWindowMonitor,
|
||||
preemptiveCompaction,
|
||||
@@ -286,5 +293,6 @@ export function createSessionHooks(args: {
|
||||
taskResumeInfo,
|
||||
anthropicEffort,
|
||||
runtimeFallback,
|
||||
legacyPluginToast,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user