[codex] Inject LSP diagnostics context#2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hookSpecificOutput.additionalContext.decision: "block"feedback path so Codex still fixes the edited file immediately.distartifacts and README behavior docs.Why
Codex now records
PostToolUseadditionalContextinto model-visible conversation context. The LSP hook already blocked on diagnostics, but it did not use the context injection path that Codex, omo, and opencode-style post-tool integrations rely on for automatic follow-up behavior.Validation
npm cinpm test -- test/codex-hook.test.tsfirst failed before implementation, then passed after the fixnpm testnpm run checkbun --install=fallback /Users/yeongyu/.agents/skills/typescript-programmer/scripts/check-no-excuse-rules.ts src/codex-hook.ts test/codex-hook.test.tsnpm pack --dry-runnode dist/cli.js hook post-tool-use < test/fixtures/post-tool-use.jsonprintf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/cli.js mcpReview
gpt-5.5xhigh expert review approved the diff with no blocking findings or required missing tests.Summary by cubic
Inject LSP diagnostics into
PostToolUsehook output so Codex sees the same errors it blocks on and can auto-fix edits. Keepsdecision: "block"behavior and adds tests for multi-file and failed mutation cases.hookSpecificOutput.additionalContextwithhookEventName: "PostToolUse".Written for commit a6e63cb. Summary will update on new commits. Review in cubic