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:
YeonGyu-Kim
2026-04-07 15:10:43 +09:00
parent 3e8fd5ff18
commit 717c976c66
4 changed files with 251 additions and 3 deletions
+1
View File
@@ -36,6 +36,7 @@ export function createCoreHooks(args: {
pluginConfig,
isHookEnabled: (name) => isHookEnabled(name as HookName),
safeHookEnabled,
ralphLoop: session.ralphLoop,
})
return {
+4 -2
View File
@@ -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