diff --git a/src/index.ts b/src/index.ts index b2ae0d19..218c425c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,6 +33,7 @@ import { } from "./hooks"; import { contextCollector, + createContextInjectorHook, createContextInjectorMessagesTransformHook, } from "./features/context-injector"; import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity"; @@ -166,6 +167,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { const keywordDetector = isHookEnabled("keyword-detector") ? createKeywordDetectorHook(ctx, contextCollector) : null; + const contextInjector = createContextInjectorHook(contextCollector); const contextInjectorMessagesTransform = createContextInjectorMessagesTransformHook(contextCollector); const agentUsageReminder = isHookEnabled("agent-usage-reminder") @@ -312,8 +314,8 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { "chat.message": async (input, output) => { await keywordDetector?.["chat.message"]?.(input, output); - // NOTE: context injection moved to messages.transform to avoid mutating UI await claudeCodeHooks["chat.message"]?.(input, output); + await contextInjector["chat.message"]?.(input, output); await autoSlashCommand?.["chat.message"]?.(input, output); await startWork?.["chat.message"]?.(input, output);