Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

## [Unreleased]

### 新增
- ChatGPT/Codex 基础模型列表新增 GPT-5.6 Sol、Terra 和 Luna

### 修复
- 修复 ChatGPT/Codex 提供商连通性测试因 Responses API 参数不兼容而失败的问题

## [0.9.14] - 2026-07-25

### 新增
Expand Down
18 changes: 18 additions & 0 deletions src/octop/infra/agents/providers/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ def load_provider_presets() -> list[dict[str, Any]]:
"input": ["text"],
},
{"id": "gpt-5.5", "name": "GPT-5.5", "enabled": True, "input": ["text"]},
{
"id": "gpt-5.6-sol",
"name": "GPT-5.6 Sol",
"enabled": True,
"input": ["text"],
},
{
"id": "gpt-5.6-terra",
"name": "GPT-5.6 Terra",
"enabled": True,
"input": ["text"],
},
{
"id": "gpt-5.6-luna",
"name": "GPT-5.6 Luna",
"enabled": True,
"input": ["text"],
},
],
"logo_id": "openai",
},
Expand Down
3 changes: 3 additions & 0 deletions src/octop/infra/agents/providers/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def build_probe_chat_model(row: Any, *, model_id: str | None = None) -> Any:
"base_url": base_url,
"api_key": row.api_key or "",
"use_responses_api": True,
"store": False,
"streaming": True,
"output_version": "v0",
}
if headers:
kwargs["default_headers"] = dict(headers)
Expand Down
3 changes: 3 additions & 0 deletions src/octop/infra/providers/codex_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{"id": "gpt-5.4", "name": "GPT-5.4", "enabled": True, "input": ["text"]},
{"id": "gpt-5.4-mini", "name": "GPT-5.4 mini", "enabled": True, "input": ["text"]},
{"id": "gpt-5.5", "name": "GPT-5.5", "enabled": True, "input": ["text"]},
{"id": "gpt-5.6-sol", "name": "GPT-5.6 Sol", "enabled": True, "input": ["text"]},
{"id": "gpt-5.6-terra", "name": "GPT-5.6 Terra", "enabled": True, "input": ["text"]},
{"id": "gpt-5.6-luna", "name": "GPT-5.6 Luna", "enabled": True, "input": ["text"]},
]


Expand Down
1 change: 1 addition & 0 deletions tests/unit/providers/test_codex_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ def test_build_codex_headers_includes_account_id() -> None:
def test_codex_provider_constants() -> None:
assert CODEX_PROVIDER_NAME == "openai-codex"
assert any(m["id"] == "gpt-5.4" for m in CODEX_MODELS)
assert {"gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"} <= {m["id"] for m in CODEX_MODELS}
4 changes: 4 additions & 0 deletions tests/unit/test_provider_preset_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def test_load_provider_presets_integration() -> None:
gpt4o = next(m for m in openai["models"] if m["id"] == "gpt-4o")
assert gpt4o.get("input") == ["text", "image"]

codex = next(p for p in presets if p["id"] == "openai-codex")
codex_ids = {m["id"] for m in codex["models"]}
assert {"gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"} <= codex_ids

kimi_cn = next(p for p in presets if p["id"] == "kimi-cn")
kimi_k25 = next(m for m in kimi_cn["models"] if m["id"] == "kimi-k2.5")
assert kimi_k25.get("input") == ["text", "image"]
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/test_provider_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,29 @@ def test_build_chat_model_includes_provider_id_and_model_name() -> None:
assert provider.name == "HAI"
assert model.id == "MiniMax-M2.7"
assert model.name == "MiniMax-M2.7"


def test_build_chat_model_uses_codex_responses_compatibility_options() -> None:
row = SimpleNamespace(
name="Codex",
kind="openai",
base_url="https://chatgpt.com/backend-api/codex",
api_key="codex-token",
extra_json='{"headers": {"ChatGPT-Account-Id": "account-id"}}',
get_models=lambda: [{"id": "gpt-5.4", "name": "GPT-5.4"}],
)

with patch("langchain_openai.ChatOpenAI") as mock_chat_openai:
mock_chat_openai.return_value = object()
_build_chat_model(row, model_id="gpt-5.4")

assert mock_chat_openai.call_args.kwargs == {
"model": "gpt-5.4",
"base_url": "https://chatgpt.com/backend-api/codex",
"api_key": "codex-token",
"use_responses_api": True,
"store": False,
"streaming": True,
"output_version": "v0",
"default_headers": {"ChatGPT-Account-Id": "account-id"},
}