# Runtime adapter: OpenAI Codex CLI
#
# Launched by `bin/agent-wrapper.sh` in the `run_codex` branch.
# MCP stdio: supported since codex-cli 0.14 (mid-2025).
# Session resume: profile-based (see `--profile`).

binary: codex
supports_mcp: true
session_resume: "profile"
default_model: gpt-5-codex
env:
  # Disable codex's own approval prompt — HITL gate in team-mcp handles this.
  CODEX_APPROVAL_MODE: "auto-edit"

rate_limit_patterns:
  - match: "(?i)rate.?limit"
    resets_in_capture: "(?i)(?:retry|try again|wait)\\s*(?:in|after)?\\s*([0-9]+\\s*(?:s|sec|m|min|h|hr)[a-z]*)"
  - match: "(?i)quota (?:exceeded|reached)"
    resets_at_capture: "(?i)reset(?:s)? (?:at|on) ([0-9]{1,2}:[0-9]{2}(?:\\s*[A-Z]{2,5})?)"
