docs(omo-codex): batch 60 (4 files)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user