diff --git a/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json b/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json new file mode 100644 index 000000000..2f8db8016 --- /dev/null +++ b/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json @@ -0,0 +1,17 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "^(apply_patch|write|Write|edit|Edit|multi_edit|multiedit|MultiEdit)$", + "hooks": [ + { + "type": "command", + "command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use", + "timeout": 30, + "statusMessage": "LazyCodex(0.1.1): Checking Comments" + } + ] + } + ] + } +} diff --git a/packages/omo-codex/plugin/components/comment-checker/skills/comment-checker/SKILL.md b/packages/omo-codex/plugin/components/comment-checker/skills/comment-checker/SKILL.md new file mode 100644 index 000000000..7ce771015 --- /dev/null +++ b/packages/omo-codex/plugin/components/comment-checker/skills/comment-checker/SKILL.md @@ -0,0 +1,16 @@ +--- +name: comment-checker +description: Use when Codex needs to understand or respond to automatic comment-checker feedback emitted after an edit-like PostToolUse hook. +--- + +# Codex Comment Checker + +The plugin registers a `PostToolUse` hook for successful `apply_patch`, `write`, `edit`, `multi_edit`, and `multiedit` calls. + +When comment-checker reports a warning after a patch, Codex receives blocking feedback and should fix or explain the flagged comment before moving on. + +## Scope + +- No MCP tool is exposed. +- Non-edit tools are ignored by this plugin. +- Missing checker binaries emit no hook output so normal Codex work can continue. diff --git a/src/features/context-injector/injector.ts b/src/features/context-injector/injector.ts index df6d27e9b..26daa444b 100644 --- a/src/features/context-injector/injector.ts +++ b/src/features/context-injector/injector.ts @@ -93,9 +93,6 @@ export function createContextInjectorMessagesTransformHook( return { "experimental.chat.messages.transform": async (_input, output) => { const { messages } = output - log("[DEBUG] experimental.chat.messages.transform called", { - messageCount: messages.length, - }) if (messages.length === 0) { return } @@ -110,7 +107,6 @@ export function createContextInjectorMessagesTransformHook( } if (lastUserMessageIndex === -1) { - log("[DEBUG] No user message found in messages") return } @@ -126,22 +122,11 @@ export function createContextInjectorMessagesTransformHook( } const messageSessionID = getSessionIDFromMessageInfo(lastUserMessage.info) const sessionID = messageSessionID ?? getMainSessionID() - log("[DEBUG] Extracted sessionID", { - messageSessionID, - mainSessionID: getMainSessionID(), - sessionID, - infoKeys: Object.keys(lastUserMessage.info), - }) if (!sessionID) { - log("[DEBUG] sessionID is undefined (both message.info and mainSessionID are empty)") return } const hasPending = collector.hasPending(sessionID) - log("[DEBUG] Checking hasPending", { - sessionID, - hasPending, - }) if (!hasPending) { return } diff --git a/src/features/team-mode/tools/lifecycle-test-fixture.ts b/src/features/team-mode/tools/lifecycle-test-fixture.ts index 22142e4a6..203ad40b7 100644 --- a/src/features/team-mode/tools/lifecycle-test-fixture.ts +++ b/src/features/team-mode/tools/lifecycle-test-fixture.ts @@ -2,7 +2,6 @@ import { mock } from "bun:test" import { randomUUID } from "node:crypto" -import { Effect } from "effect" import type { ToolContext } from "@opencode-ai/plugin/tool" @@ -32,7 +31,7 @@ export function createToolContext(sessionID: string): ToolContext { worktree: "/project", abort: new AbortController().signal, metadata: () => {}, - ask: async () => {}, + ask: async () => undefined, } }