fix(context-injector): inject via chat.message after claudeCodeHooks
- Revert messages.transform-only approach (experimental hook unreliable) - Inject context in chat.message after claudeCodeHooks runs - Order: keywordDetector → claudeCodeHooks → contextInjector - Works independently of claude-code-hooks being enabled/disabled - Ultrawork content now reliably injected to model
This commit is contained in:
parent
2a95c91cab
commit
1bbb61b1c2
@ -33,6 +33,7 @@ import {
|
|||||||
} from "./hooks";
|
} from "./hooks";
|
||||||
import {
|
import {
|
||||||
contextCollector,
|
contextCollector,
|
||||||
|
createContextInjectorHook,
|
||||||
createContextInjectorMessagesTransformHook,
|
createContextInjectorMessagesTransformHook,
|
||||||
} from "./features/context-injector";
|
} from "./features/context-injector";
|
||||||
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
|
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
|
||||||
@ -166,6 +167,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
const keywordDetector = isHookEnabled("keyword-detector")
|
const keywordDetector = isHookEnabled("keyword-detector")
|
||||||
? createKeywordDetectorHook(ctx, contextCollector)
|
? createKeywordDetectorHook(ctx, contextCollector)
|
||||||
: null;
|
: null;
|
||||||
|
const contextInjector = createContextInjectorHook(contextCollector);
|
||||||
const contextInjectorMessagesTransform =
|
const contextInjectorMessagesTransform =
|
||||||
createContextInjectorMessagesTransformHook(contextCollector);
|
createContextInjectorMessagesTransformHook(contextCollector);
|
||||||
const agentUsageReminder = isHookEnabled("agent-usage-reminder")
|
const agentUsageReminder = isHookEnabled("agent-usage-reminder")
|
||||||
@ -312,8 +314,8 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
|
|
||||||
"chat.message": async (input, output) => {
|
"chat.message": async (input, output) => {
|
||||||
await keywordDetector?.["chat.message"]?.(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 claudeCodeHooks["chat.message"]?.(input, output);
|
||||||
|
await contextInjector["chat.message"]?.(input, output);
|
||||||
await autoSlashCommand?.["chat.message"]?.(input, output);
|
await autoSlashCommand?.["chat.message"]?.(input, output);
|
||||||
await startWork?.["chat.message"]?.(input, output);
|
await startWork?.["chat.message"]?.(input, output);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user