Support Codex comment checker hooks#2
Conversation
Restore edit-like PostToolUse matching and extraction for Write, Edit, MultiEdit, and apply_patch. Forward Codex transcript_path into the native checker while preserving no-op behavior when checker execution fails or has no finding. Plan: plans/post-hook-support-codex-plugins.md
Make the native checker optional, cap child process output, pin plugin metadata, and use Codex-managed plugin-root interpolation. Add package/resource regression tests and Windows CI coverage. Plan: ../plans/plugin-portability-hardening.md
Git on Windows defaults to core.autocrlf=true and converts LF to CRLF on checkout, which makes biome's --check fail on every TypeScript file. Add a .gitattributes that forces LF on every checkout so the Windows CI matrix matches Linux/macOS. Plan: ../plans/plugin-portability-hardening.md
Treat malformed or non-object hook stdin as irrelevant input so Codex does not surface a PostToolUse hook failure for stray source text. Plan: /Users/yeongyu/local-workspaces/codex-plugins/plans/posttooluse-hook-hardening.md
Use the optional checker package API before the legacy bin-path fallback so the vendored 0.7.1 binary is discovered in local plugin installs. Plan: /Users/yeongyu/local-workspaces/codex-plugins/plans/posttooluse-hook-hardening.md
There was a problem hiding this comment.
3 issues found across 27 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/core.ts">
<violation number="1" location="src/core.ts:130">
P2: `extractEditRequest` should require both `old_string` and `new_string`; current logic accepts malformed one-sided edits and forwards invalid checker input.</violation>
</file>
<file name="test/runner.test.ts">
<violation number="1" location="test/runner.test.ts:38">
P3: Don't assert `vendor` in the resolved binary path; the resolver also has a valid non-vendor fallback path.</violation>
</file>
<file name="src/codex-hook.ts">
<violation number="1" location="src/codex-hook.ts:50">
P2: `transcript_path` is forwarded without a runtime type check, but the input guard does not validate that field. Malformed payloads can pass and propagate a non-string transcript path.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
Status update: CI matrix, GitGuardian, and Cubic are all green for head 3f1348f. The earlier Cubic findings were fixed, but the PR remains REVIEW_REQUIRED / BLOCKED by base branch policy, and repository auto-merge is disabled. Please review and merge through the protected-branch flow; no admin bypass was used. |
|
Status update: CI matrix, GitGuardian, and Cubic are green for head 3f1348f. The earlier Cubic findings were fixed, but this remains REVIEW_REQUIRED / BLOCKED by base branch policy, and repository auto-merge is disabled. Please review and merge through the protected-branch flow. No admin bypass was used. |
Summary
Improvement table
test/codex-hook.test.ts.test/codex-hook.test.tsand manual CLI smoke.MAX_PROCESS_OUTPUT_BYTES = 64 KiB; noisy stderr is truncated with marker.test/runner.test.ts.missingresult and emits no hook output.test/runner.test.ts.Verification
Review