-
Notifications
You must be signed in to change notification settings - Fork 0
Capture native Codex exec context #671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
afa512b
dc2a38d
88decd5
8913c1a
2bd1328
594ec08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@donadiosolutions/lcm": patch | ||
| --- | ||
|
|
||
| Capture bounded semantic context from Codex `functions.exec` and | ||
| `functions.exec_command` PostToolUse events, and validate the installed Codex | ||
| hook with structural and no-write functional connector checks. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2380,6 +2380,7 @@ export async function runCli( | |
|
|
||
| const installed = listConnectors(opts.global ? homedir() : process.cwd()); | ||
| console.log("\n Connector health:\n"); | ||
| let failures = 0; | ||
| for (const agent of agents) { | ||
| const agentConnectors = installed.filter((c: any) => c.agentId === (agent as any).id); | ||
| if ((agentConnectors as any[]).length === 0) { | ||
|
|
@@ -2389,8 +2390,40 @@ export async function runCli( | |
| console.log(` ✓ ${(agent as any).name}: ${c.type} at ${c.path}`); | ||
| } | ||
| } | ||
|
|
||
| if ((agent as any).id !== "codex" || agentName === undefined) continue; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Undocumented as any cast A new (agent as any) cast was added without an adjacent justification comment. This violates the requirement that each as any usage in changed TypeScript code be explicitly justified. Agent Prompt
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5. Codex health check skipped without explicit agent The connectors doctor command's new Codex structural/functional check is guarded by `agentName === undefined, so running the documented broad lcm connectors doctor` (no agent argument) silently skips both the exact PostToolUse structural inspection and the native-exec functional probe, even though the loop still iterates Codex within the AGENTS list. This causes the new health verification introduced by this PR to be effectively unreachable for the command's most common invocation form. Agent Prompt
|
||
|
|
||
| const { | ||
| inspectCodexPostToolHook, | ||
| resolveCodexHooksPath, | ||
| } = await import("../src/connectors/codex-hooks.js"); | ||
| const { codexPostToolFunctionalCoverage } = await import("../src/hooks/post-tool-normalization.js"); | ||
| const inspection = inspectCodexPostToolHook( | ||
| resolveCodexHooksPath(opts.global ? homedir() : process.cwd()), | ||
| ); | ||
|
Comment on lines
+2401
to
+2403
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. Doctor ignores hooks feature flag Targeted Codex doctor declares PostToolUse installed after checking only hooks.json, while Codex also requires [features].hooks = true in config.toml. If that flag is missing or disabled, the pure adapter probe still passes and doctor reports healthy even though Codex will not dispatch the hook. Agent Prompt
|
||
|
|
||
| if (inspection.state === "installed") { | ||
| console.log(" ✓ Codex: PostToolUse hook installed"); | ||
| let functional = false; | ||
| try { | ||
| functional = codexPostToolFunctionalCoverage(); | ||
| } catch { | ||
| functional = false; | ||
| } | ||
| if (functional) { | ||
| console.log(" ✓ Codex: native exec capture functional"); | ||
| } else { | ||
| console.log(" ✗ Codex: native exec capture functional"); | ||
| failures += 1; | ||
| } | ||
| } else { | ||
| console.log(` ✗ Codex: PostToolUse hook ${inspection.state}`); | ||
| console.log(" Codex: native exec capture functional check skipped"); | ||
| failures += 1; | ||
| } | ||
| } | ||
| console.log(); | ||
| if (failures > 0) exit(1); | ||
| }); | ||
|
|
||
| program.addCommand(connectorsCmd); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. @donadiosolutions/lcm patch bump too low
📘 Rule violation§ ComplianceAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools