Skip to content

feat(codex): nudge Gortex MCP read tools toward compressed reads#218

Merged
zzet merged 1 commit into
zzet:mainfrom
blankanswer:feat/codex-mcp-read-pretooluse
Jul 2, 2026
Merged

feat(codex): nudge Gortex MCP read tools toward compressed reads#218
zzet merged 1 commit into
zzet:mainfrom
blankanswer:feat/codex-mcp-read-pretooluse

Conversation

@blankanswer

Copy link
Copy Markdown
Contributor

Summary

  • Add a dedicated Codex PreToolUse matcher for Gortex MCP read-shaped tools:
    mcp__gortex__read_file and mcp__gortex__get_editing_context.
  • Route those Codex MCP read tool events through a Codex-specific soft-only handler.
  • Reuse the existing gortexReadNudge compress-bodies guidance without adding new policy.
  • Keep Codex MCP read guidance advisory-only: emit hookSpecificOutput.additionalContext; no permission decision, deny, input rewrite, or output suppression.

Design notes

  • The Bash PreToolUse matcher remains separate from the MCP read-tool matcher.
  • The Codex installer now manages two Gortex-owned PreToolUse entries: one for Bash and one for MCP read tools.
  • Repeated apply remains idempotent; force refresh removes stale Gortex-owned PreToolUse entries and writes the two desired entries back.
  • The MCP read-tool path intentionally does not call the generic runPreToolUse handler, so permissive permission_mode values cannot emit permissionDecision:"allow".
  • Claude, Gemini, and Antigravity behavior remains unchanged.

Out of scope

  • All other mcp__gortex__* tools
  • PostToolUse MCP output
  • apply_patch
  • deny / enforcement behavior
  • permission decisions
  • input rewrite / updatedInput
  • output suppression
  • resolver / indexer / daemon / graph / MCP tool changes

Tests

  • go test ./internal/agents/codex
  • go test ./internal/hooks
  • go test ./cmd/gortex
  • git diff --check

@zzet zzet merged commit 21af10b into zzet:main Jul 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants