fix: support multi-agent detection and deny git#202
Merged
Conversation
WHY The hook check only recognized Codex JSON shapes, causing it to silently ignore or fail to block git commands from other AI agents like Claude Code and Antigravity. Additionally, the previous 'ask' policy for git commands required manual intervention. WHAT * Added agent detection logic to identify Codex, Claude Code, and Antigravity inputs based on top-level JSON keys. * Implemented specific deny output formats for each supported agent to properly block raw git execution. * Updated OpenCode policy configuration in mcp_config.go to set git bash permissions to 'deny'.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Resolve conflicts in hook_check.go and hook_check_test.go by keeping the multi-agent detection from feat/hooks-multi-agente (Codex, Claude Code, Antigravity) while preserving the deny permission pattern and AdditionalContext assertions from main.
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.
Closes #199
PR Type
Summary
runStdinModenow detects Codex, Claude Code, and Antigravity from stdin JSON keyspermissionDecision: "deny"(wasadditionalContextsuggestion){"allow_tool": false, "deny_reason": "..."}with exit 0"ask"to"deny"forbash["git *"]Changes
internal/delivery/cli/hook_check.gohookInputstruct,agentTypeenum,antigravityHookOutputstruct,runStdinModerewrite with nil-check dispatchinternal/delivery/cli/hook_check_test.gointernal/installer/mcp_config.gobash["git *"] = "ask"→"deny"internal/installer/opencode_policy_test.go"deny"internal/installer/v26_test.go"deny"Test Plan
go test ./internal/delivery/cli/...passesgo test ./internal/installer/...passesgo build ./...passesgo test ./...passesContributor Checklist
type:*labelCo-Authored-Bytrailers