Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,65 @@ SKIP_OAUTH_INIT_CHECK=false
# Default: 8085 (same as Gemini CLI, shared)
# ANTIGRAVITY_OAUTH_PORT=8085

# ------------------------------------------------------------------------------
# | [CODEX] OpenAI Codex Provider Configuration |
# ------------------------------------------------------------------------------
#
# Codex provider uses OAuth authentication with OpenAI's ChatGPT backend API.
# Credentials are stored in oauth_creds/ directory as codex_oauth_*.json files.
#

# --- Reasoning Effort ---
# Controls how much "thinking" the model does before responding.
# Higher effort = more thorough reasoning but slower responses.
#
# Available levels (model-dependent):
# - low: Minimal reasoning, fastest responses
# - medium: Balanced (default)
# - high: More thorough reasoning
# - xhigh: Maximum reasoning (gpt-5.2, gpt-5.2-codex, gpt-5.1-codex-max only)
#
# Can also be controlled per-request via:
# 1. Model suffix: codex/gpt-5.2:high
# 2. Request param: "reasoning_effort": "high"
#
# CODEX_REASONING_EFFORT=medium

# --- Reasoning Summary ---
# Controls how reasoning is summarized in responses.
# Options: auto, concise, detailed, none
# CODEX_REASONING_SUMMARY=auto

# --- Reasoning Output Format ---
# How reasoning/thinking is presented in responses.
# Options:
# - think-tags: Wrap in <think>...</think> tags (default, matches other providers)
# - raw: Include reasoning as-is
# - none: Don't include reasoning in output
# CODEX_REASONING_COMPAT=think-tags

# --- Identity Override ---
# When true, injects an override that tells the model to prioritize
# user-provided system prompts over the required opencode instructions.
# CODEX_INJECT_IDENTITY_OVERRIDE=true

# --- Instruction Injection ---
# When true, injects the required opencode system instruction.
# Only disable if you know what you're doing (API may reject requests).
# CODEX_INJECT_INSTRUCTION=true

# --- Empty Response Handling ---
# Number of retry attempts when receiving empty responses.
# CODEX_EMPTY_RESPONSE_ATTEMPTS=3

# Delay (seconds) between empty response retries.
# CODEX_EMPTY_RESPONSE_RETRY_DELAY=2

# --- OAuth Configuration ---
# OAuth callback port for Codex interactive authentication.
# Default: 8086
# CODEX_OAUTH_PORT=8086

# ------------------------------------------------------------------------------
# | [ADVANCED] Debugging / Logging |
# ------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/rotator_library/credential_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"qwen_code": Path.home() / ".qwen",
"iflow": Path.home() / ".iflow",
"antigravity": Path.home() / ".antigravity",
"codex": Path.home() / ".codex",
# Add other providers like 'claude' here if they have a standard CLI path
}

Expand All @@ -25,6 +26,7 @@
"antigravity": "ANTIGRAVITY",
"qwen_code": "QWEN_CODE",
"iflow": "IFLOW",
"codex": "CODEX",
}


Expand Down
1 change: 1 addition & 0 deletions src/rotator_library/credential_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _ensure_providers_loaded():
"qwen_code": "Qwen Code",
"iflow": "iFlow",
"antigravity": "Antigravity",
"codex": "OpenAI Codex",
}


Expand Down
2 changes: 2 additions & 0 deletions src/rotator_library/provider_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
from .providers.qwen_auth_base import QwenAuthBase
from .providers.iflow_auth_base import IFlowAuthBase
from .providers.antigravity_auth_base import AntigravityAuthBase
from .providers.openai_oauth_base import OpenAIOAuthBase

PROVIDER_MAP = {
"gemini_cli": GeminiAuthBase,
"qwen_code": QwenAuthBase,
"iflow": IFlowAuthBase,
"antigravity": AntigravityAuthBase,
"codex": OpenAIOAuthBase,
}

def get_provider_auth_class(provider_name: str):
Expand Down
318 changes: 318 additions & 0 deletions src/rotator_library/providers/codex_prompt.txt

Large diffs are not rendered by default.

Loading