Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
非空但没有有效 slug 的 Codex 响应仍会被错误地报告为成功。
1 open finding
What changed in this PR
该 PR 修复 Codex 模型发现协议兼容问题。
Changes:
- 携带
client_version并识别 Codex 端点。 - 解析、去重并排序 Codex 模型数据。
- 新增本地化错误信息和协议回归测试。
| File | Description |
|---|---|
src/octop/infra/agents/providers/probe.py |
实现 Codex 请求与响应适配 |
tests/unit/test_codex_fetch_models_http.py |
覆盖 Codex 和 OpenAI 协议 |
src/octop/i18n/en.json |
添加英文错误信息 |
src/octop/i18n/zh.json |
添加中文错误信息 |
CHANGELOG.md |
记录用户可见修复 |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #1992.
Codex model discovery uses a different contract from OpenAI's
/models: it requiresclient_versionand returnsmodels[].slugwithdisplay_name. The shared fetcher currently omits the query parameter and only acceptsdata[].id, so fetching the Codex model list fails.CODEX_ATTRIBUTION_VERSION, including its existing environment override, for the Codex query parameter.Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
make allpasses locallyThe new tests use a real loopback HTTP server serving JSON fixtures, with the production HTTP client unchanged. They check the query parameter, authorization/account headers, normalization, deduplication, sorting, empty/malformed lists, localized errors, and ordinary OpenAI behavior. The initial nine regression cases produced five failures against the unmodified code; the targeted suite now passes all 105 tests, including 17 new cases. Running the request regression again with
OCTOP_CODEX_ATTRIBUTION_VERSION=2026.10.13-testalso passes, checking the existing configuration override.After merging develop at
99e479a6,make allpassed on Windows / Python 3.12: 4,618 passed, 211 skipped (10 existing-suite warnings). GNU Make usedSHELL=bashandPYTEST_JOBS=2. The first full run had one existing subprocess test exceed its 20-second timeout; its isolated recheck and the full rerun passed without changing the test or timeout. No authenticated live Codex request was performed.The normal pre-commit gate passed, including 340 testmon-selected tests (using pytest's two-worker option) and
dashboard npm run build(tsc -band Vite/PWA build). No checks were bypassed.Checklist
CHANGELOG.md(if user-facing)Prepared with AI assistance.
Review follow-up: two non-empty invalid response fixtures, checked in both languages, reproduced four failures before the fix and now return the existing localized error. The valid empty-list and mixed-validity cases remain covered.