fix: remove task-continuation-enforcer references after dev merge

Dev removed task-continuation-enforcer entirely. Remove all remaining
references from plugin hooks, event handler, tool-execute-before, and
config schema to align with origin/dev.
This commit is contained in:
YeonGyu-Kim 2026-02-08 21:11:07 +09:00
parent 46a30cd7ec
commit fecc6b8605
8 changed files with 16 additions and 30 deletions

View File

@ -2,7 +2,6 @@ import { z } from "zod"
export const HookNameSchema = z.enum([
"todo-continuation-enforcer",
"task-continuation-enforcer",
"context-window-monitor",
"session-recovery",
"session-notification",

View File

@ -1,3 +1,3 @@
export { createInteractiveBashSessionHook } from "./interactive-bash-session-hook"
export { createInteractiveBashSessionHook } from "./hook"
export { createInteractiveBashSessionTracker } from "./interactive-bash-session-tracker"
export { parseTmuxCommand } from "./tmux-command-parser"

View File

@ -1,4 +1,4 @@
/// <reference path="../../node_modules/bun-types/test.d.ts" />
/// <reference types="bun-types" />
import { describe, test, expect, spyOn, beforeEach, afterEach } from "bun:test"
import { resolveCategoryConfig, createConfigHandler } from "./config-handler"

View File

@ -33,7 +33,6 @@ export function createEventHandler(args: {
await Promise.resolve(hooks.backgroundNotificationHook?.event?.(input))
await Promise.resolve(hooks.sessionNotification?.(input))
await Promise.resolve(hooks.todoContinuationEnforcer?.handler?.(input))
await Promise.resolve(hooks.taskContinuationEnforcer?.handler?.(input))
await Promise.resolve(hooks.unstableAgentBabysitter?.event?.(input))
await Promise.resolve(hooks.contextWindowMonitor?.event?.(input))
await Promise.resolve(hooks.directoryAgentsInjector?.event?.(input))

View File

@ -4,7 +4,6 @@ import type { PluginContext } from "../types"
import {
createTodoContinuationEnforcer,
createTaskContinuationEnforcer,
createBackgroundNotificationHook,
createStopContinuationGuardHook,
createCompactionContextInjector,
@ -19,7 +18,6 @@ export type ContinuationHooks = {
compactionContextInjector: ReturnType<typeof createCompactionContextInjector> | null
compactionTodoPreserver: ReturnType<typeof createCompactionTodoPreserverHook> | null
todoContinuationEnforcer: ReturnType<typeof createTodoContinuationEnforcer> | null
taskContinuationEnforcer: ReturnType<typeof createTaskContinuationEnforcer> | null
unstableAgentBabysitter: ReturnType<typeof createUnstableAgentBabysitter> | null
backgroundNotificationHook: ReturnType<typeof createBackgroundNotificationHook> | null
atlasHook: ReturnType<typeof createAtlasHook> | null
@ -70,14 +68,6 @@ export function createContinuationHooks(args: {
}))
: null
const taskContinuationEnforcer = isHookEnabled("task-continuation-enforcer")
? safeHook("task-continuation-enforcer", () =>
createTaskContinuationEnforcer(ctx, pluginConfig, {
backgroundManager,
isContinuationStopped: stopContinuationGuard?.isStopped,
}))
: null
const unstableAgentBabysitter = isHookEnabled("unstable-agent-babysitter")
? safeHook("unstable-agent-babysitter", () =>
createUnstableAgentBabysitter({ ctx, backgroundManager, pluginConfig }))
@ -91,10 +81,7 @@ export function createContinuationHooks(args: {
onAbortCallbacks.push(todoContinuationEnforcer.markRecovering)
onRecoveryCompleteCallbacks.push(todoContinuationEnforcer.markRecoveryComplete)
}
if (taskContinuationEnforcer) {
onAbortCallbacks.push(taskContinuationEnforcer.markRecovering)
onRecoveryCompleteCallbacks.push(taskContinuationEnforcer.markRecoveryComplete)
}
if (onAbortCallbacks.length > 0) {
sessionRecovery.setOnAbortCallback((sessionID: string) => {
@ -129,7 +116,6 @@ export function createContinuationHooks(args: {
compactionContextInjector,
compactionTodoPreserver,
todoContinuationEnforcer,
taskContinuationEnforcer,
unstableAgentBabysitter,
backgroundNotificationHook,
atlasHook,

View File

@ -88,7 +88,6 @@ export function createToolExecuteBeforeHandler(args: {
if (command === "stop-continuation" && sessionID) {
hooks.stopContinuationGuard?.stop(sessionID)
hooks.todoContinuationEnforcer?.cancelAllCountdowns()
hooks.taskContinuationEnforcer?.cancelAllCountdowns()
hooks.ralphLoop?.cancelLoop(sessionID)
clearBoulderState(ctx.directory)
log("[stop-continuation] All continuation mechanisms stopped", {

View File

@ -1,12 +1,10 @@
import { tool, type PluginInput, type ToolDefinition } from "@opencode-ai/plugin"
import { ALLOWED_AGENTS, CALL_OMO_AGENT_DESCRIPTION } from "./constants"
import type { CallOmoAgentArgs } from "./types"
import type { AllowedAgentType, CallOmoAgentArgs, ToolContextWithMetadata } from "./types"
import type { BackgroundManager } from "../../features/background-agent"
import { log } from "../../shared"
import { normalizeAgentType } from "./agent-type-normalizer"
import { executeBackgroundAgent } from "./background-agent-executor"
import { executeSyncAgent } from "./sync-agent-executor"
import type { ToolContextWithMetadata } from "./tool-context-with-metadata"
import { executeBackground } from "./background-executor"
import { executeSync } from "./sync-executor"
export function createCallOmoAgent(
ctx: PluginInput,
@ -34,21 +32,26 @@ export function createCallOmoAgent(
const toolCtx = toolContext as ToolContextWithMetadata
log(`[call_omo_agent] Starting with agent: ${args.subagent_type}, background: ${args.run_in_background}`)
const normalizedAgent = normalizeAgentType(args.subagent_type)
if (!normalizedAgent) {
// Case-insensitive agent validation - allows "Explore", "EXPLORE", "explore" etc.
if (
!ALLOWED_AGENTS.some(
(name) => name.toLowerCase() === args.subagent_type.toLowerCase(),
)
) {
return `Error: Invalid agent type "${args.subagent_type}". Only ${ALLOWED_AGENTS.join(", ")} are allowed.`
}
const normalizedAgent = args.subagent_type.toLowerCase() as AllowedAgentType
args = { ...args, subagent_type: normalizedAgent }
if (args.run_in_background) {
if (args.session_id) {
return `Error: session_id is not supported in background mode. Use run_in_background=false to continue an existing session.`
}
return await executeBackgroundAgent(args, toolCtx, backgroundManager)
return await executeBackground(args, toolCtx, backgroundManager)
}
return await executeSyncAgent(args, toolCtx, ctx)
return await executeSync(args, toolCtx, ctx)
},
})
}

View File

@ -1,6 +1,6 @@
export type { ExecutorContext, ParentContext } from "./executor-types"
export { resolveSkillContent } from "./skill-content-resolver"
export { resolveSkillContent } from "./skill-resolver"
export { resolveParentContext } from "./parent-context-resolver"
export { executeBackgroundContinuation } from "./background-continuation"