Skip to content

Auto-approve loop bridge MCP tools for Codex#48

Merged
axeldelafosse merged 3 commits intomainfrom
codex/loop-bridge-auto-approve
Mar 27, 2026
Merged

Auto-approve loop bridge MCP tools for Codex#48
axeldelafosse merged 3 commits intomainfrom
codex/loop-bridge-auto-approve

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

@axeldelafosse axeldelafosse commented Mar 27, 2026

Summary

  • add explicit Codex MCP approval overrides for the fixed loop-bridge tools
  • keep Claude bridge config unchanged because it uses a separate MCP config path
  • extend bridge and startup tests to cover the extra Codex -c overrides

Why

Recent Codex releases gate custom MCP tools through per-tool approval settings under mcp_servers..tools..approval_mode. There is no server-wide trust or approval override for custom MCP servers, so loop needs to pass explicit approve overrides for its bridge tools when it launches Codex.

Verification

  • bun test tests/loop/bridge.test.ts
  • bun test tests/loop/codex-app-server.test.ts
  • bun test tests/loop/paired-loop.test.ts
  • bun run check

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces auto-approval configuration for specific Codex bridge tools by appending approval mode arguments to the MCP server setup. While the logic correctly targets the intended tools, the feedback points out a potential bug where the stringifyToml function might double-quote the approval mode value, which could prevent the configuration from being parsed correctly.

Comment on lines +30 to +31
CODEX_BRIDGE_APPROVAL_MODE
)}`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The stringifyToml function is incorrectly applied to CODEX_BRIDGE_APPROVAL_MODE. The CODEX_BRIDGE_APPROVAL_MODE constant is already a string that should be directly quoted in the configuration argument. Applying JSON.stringify (which stringifyToml does) results in double-quoting (e.g., ""approve"" instead of "approve"), which could lead to incorrect parsing by the MCP server and prevent the auto-approval from functioning as intended. The tests also expect a single layer of quoting.

To fix this, CODEX_BRIDGE_APPROVAL_MODE should be directly embedded within the string literal, ensuring it is quoted only once.

    mcp_servers.${BRIDGE_SERVER}.tools.${tool}.approval_mode="${CODEX_BRIDGE_APPROVAL_MODE}"

@axeldelafosse axeldelafosse marked this pull request as ready for review March 27, 2026 19:10
@axeldelafosse axeldelafosse merged commit 60436f6 into main Mar 27, 2026
2 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.

1 participant