diff --git a/src/hooks/keyword-detector/index.ts b/src/hooks/keyword-detector/index.ts index 1d44be8..d3f2deb 100644 --- a/src/hooks/keyword-detector/index.ts +++ b/src/hooks/keyword-detector/index.ts @@ -6,8 +6,6 @@ export * from "./detector" export * from "./constants" export * from "./types" -const injectedSessions = new Set() - export function createKeywordDetectorHook() { return { "chat.message": async ( @@ -22,10 +20,6 @@ export function createKeywordDetectorHook() { parts: Array<{ type: string; text?: string; [key: string]: unknown }> } ): Promise => { - if (injectedSessions.has(input.sessionID)) { - return - } - const promptText = extractPromptText(output.parts) const messages = detectKeywords(promptText) @@ -52,22 +46,8 @@ export function createKeywordDetectorHook() { }) if (success) { - injectedSessions.add(input.sessionID) log("Keyword context injected", { sessionID: input.sessionID }) } }, - - event: async ({ - event, - }: { - event: { type: string; properties?: unknown } - }) => { - if (event.type === "session.deleted") { - const props = event.properties as { info?: { id?: string } } | undefined - if (props?.info?.id) { - injectedSessions.delete(props.info.id) - } - } - }, } } diff --git a/src/index.ts b/src/index.ts index 86ecc47..72fc913 100644 --- a/src/index.ts +++ b/src/index.ts @@ -410,7 +410,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await rulesInjector?.event(input); await thinkMode?.event(input); await anthropicAutoCompact?.event(input); - await keywordDetector?.event(input); await agentUsageReminder?.event(input); await interactiveBashSession?.event(input);