Skip to content

The agent that grows with you

feat(providers): accept `chatgpt` / `chatgpt-codex` as names for the openai-codex provider

teknium1dc9fec7d60ee
diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py
index fe5a09936cc..28b31563a94 100644
--- a/hermes_cli/auth.py
+++ b/hermes_cli/auth.py
@@ -1187,6 +1187,7 @@ _PROVIDER_ALIASES: Dict[str, str] = {
"go": "opencode-go", "opencode-go-sub": "opencode-go",
"kilo": "kilocode", "kilo-code": "kilocode", "kilo-gateway": "kilocode",
"lmstudio": "lmstudio", "lm-studio": "lmstudio", "lm_studio": "lmstudio",
+ "chatgpt": "openai-codex", "chatgpt-codex": "openai-codex",
# Local server aliases — route through the generic custom provider
"ollama": "custom", "ollama_cloud": "ollama-cloud",
"vllm": "custom", "llamacpp": "custom",
diff --git a/hermes_cli/providers.py b/hermes_cli/providers.py
index a27fe47df1b..250f44955c1 100644
--- a/hermes_cli/providers.py
+++ b/hermes_cli/providers.py
@@ -119,7 +119,8 @@ _ALIAS_GROUPS: Dict[str, Tuple[str, ...]] = {
"kimi-for-coding": ("kimi", "kimi-coding", "kimi-coding-cn", "moonshot"),
"stepfun": ("step", "stepfun-coding-plan"), "minimax-cn": ("minimax-china", "minimax_cn"),
"anthropic": ("claude", "claude-code"), "github-copilot": ("copilot", "github"),
- "copilot-acp": ("github-copilot-acp",), "vercel": ("ai-gateway", "aigateway", "vercel-ai-gateway"),
+ "copilot-acp": ("github-copilot-acp",), "openai-codex": ("chatgpt", "chatgpt-codex"),
+ "vercel": ("ai-gateway", "aigateway", "vercel-ai-gateway"),
"opencode": ("opencode-zen", "zen"), "opencode-go": ("go", "opencode-go-sub"), "kilo": ("kilocode", "kilo-code", "kilo-gateway"),
"deepseek": ("deep-seek",), "alibaba": ("dashscope", "aliyun", "qwen", "alibaba-cloud"),
"alibaba-coding-plan": ("alibaba_coding", "alibaba-coding", "alibaba_coding_plan"),
diff --git a/tests/hermes_cli/test_api_key_providers.py b/tests/hermes_cli/test_api_key_providers.py
index af3c741bafd..97c262de33d 100644
--- a/tests/hermes_cli/test_api_key_providers.py
+++ b/tests/hermes_cli/test_api_key_providers.py
@@ -218,6 +218,11 @@ class TestResolveProvider:
assert resolve_provider("Z-AI") == "zai"
assert resolve_provider("Kimi") == "kimi-coding"
+ def test_alias_chatgpt(self):
+ """Issue #95794: ``--provider chatgpt`` selects the ChatGPT-backed Codex OAuth provider."""
+ assert resolve_provider("chatgpt") == "openai-codex"
+ assert resolve_provider("chatgpt-codex") == "openai-codex"
+
def test_alias_github_copilot(self):
assert resolve_provider("github-copilot") == "copilot"