Repository navigation
feat(codex): CPR-style model_mappings for codex-auto-review (#526) - #598
Conversation
Add CPR-style routing.codex.model_mappings applied before platform detect, with product defaults codex-auto-review→gpt-6-luna and empty-target fallback to gpt-6.1-sol. Validates GPT targets, preserves requested vs upstream logs, docs and unit tests. Co-authored-by: ted <kuhlmangarry24@gmail.com>
55afa54 to
8b40b4a
Compare
Co-authored-by: ted <kuhlmangarry24@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 847c2cb. Configure here.
| } | ||
| merged[alias] = String(value).trim() | ||
| } | ||
| return merged |
There was a problem hiding this comment.
Fallback mapping target not catalog-safe
Medium Severity
Clearing codex-auto-review is documented to fall back to gpt-6.1-sol, but that id is not in seedGptPolicy, patch validation skips empty values, and persist then stores the resolved fallback. After a Codex catalog sync, unseen GPT ids start disabled (or are unknown), so auto-review requests 400 with model_disabled, and a later PUT of the GET payload can fail even though the empty save succeeded.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 847c2cb. Configure here.


Summary
Implements REQ-0526 / #526: inbound exact model mapping before
detectInboundPlatform, aligned with codex-proxy-rsmodelMappings.routing.codex.model_mappings: client model id → upstream GPT id; hot-reloads with other routing keys vianormalizeCodexRouting.codex-auto-review→gpt-6-luna; explicit empty target for that key →gpt-6.1-sol.body.modelinhandle-protocolbefore platform detect; literaldetectInboundPlatform('codex-auto-review')unchanged (fail-close).codex_model_mapping_invalid/model_disabled); no Anthropic hop.logBag.upstream_modelon rewrite;requested_modelstays the client value (billing uses upstream per existing log pipeline).Tests
test/unit/codex-model-mapping.test.mjs: defaults, override, fallback, invalid/disabled targets, source-order check.Docs
docs/PANEL_API.mdops note;CHANGELOG.md未发布 entry.Follow-up
codex.model_mappings(config-only for MVP).Closes #526
Note
Medium Risk
Changes Codex inbound model resolution and platform detection order; misconfiguration could block or mis-route requests, but targets are validated against GPT policy before hop.
Reviewed by Cursor Bugbot for commit 847c2cb. Configure here.