fix(keyword-detector): start ralph-loop when ulw keyword detected (#3113)
Plain 'ulw' keyword now starts the continuation loop via ralphLoop.startLoop(), matching README promise. Wired through create-core-hooks.ts and create-transform-hooks.ts. TDD: 40 keyword-detector tests pass, 1239 hook tests pass, tsc clean. Closes #3113
This commit is contained in:
@@ -36,6 +36,7 @@ export function createCoreHooks(args: {
|
||||
pluginConfig,
|
||||
isHookEnabled: (name) => isHookEnabled(name as HookName),
|
||||
safeHookEnabled,
|
||||
ralphLoop: session.ralphLoop,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { OhMyOpenCodeConfig } from "../../config"
|
||||
import type { PluginContext } from "../types"
|
||||
import type { RalphLoopHook } from "../../hooks/ralph-loop"
|
||||
|
||||
import {
|
||||
createClaudeCodeHooksHook,
|
||||
@@ -26,8 +27,9 @@ export function createTransformHooks(args: {
|
||||
pluginConfig: OhMyOpenCodeConfig
|
||||
isHookEnabled: (hookName: string) => boolean
|
||||
safeHookEnabled?: boolean
|
||||
ralphLoop?: RalphLoopHook | null
|
||||
}): TransformHooks {
|
||||
const { ctx, pluginConfig, isHookEnabled } = args
|
||||
const { ctx, pluginConfig, isHookEnabled, ralphLoop } = args
|
||||
const safeHookEnabled = args.safeHookEnabled ?? true
|
||||
|
||||
const claudeCodeHooks = isHookEnabled("claude-code-hooks")
|
||||
@@ -49,7 +51,7 @@ export function createTransformHooks(args: {
|
||||
const keywordDetector = isHookEnabled("keyword-detector")
|
||||
? safeCreateHook(
|
||||
"keyword-detector",
|
||||
() => createKeywordDetectorHook(ctx, contextCollector),
|
||||
() => createKeywordDetectorHook(ctx, contextCollector, ralphLoop ?? undefined),
|
||||
{ enabled: safeHookEnabled },
|
||||
)
|
||||
: null
|
||||
|
||||
Reference in New Issue
Block a user