Repository navigation
fix(pricing): isolate structured OpenRouter quotes during automatic sync - #791
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 11, 2026
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.
LMM API Pull Request
变更说明 / Summary
OpenRouter 的模型目录已出现
pricing.overrides数组。原同步程序将整个pricing解码为map[string]string,一条结构化报价就会使整个渠道同步失败,报cannot unmarshal array ... pricing ... string。现在先保留每个模型的原始报价,再逐模型校验。普通字符串报价继续走现有自动同步;结构化字段、非字符串价格和无效报价对象仅跳过所属模型,并在
test_results.skipped_models返回原因。仍拒绝无法表示的收费维度,避免把分档价格导入成更便宜的基础价。整份损坏的 JSON 仍报错。新增回归覆盖数组、对象、数字、null、无效报价对象,以及真实 fetch handler:有效模型仍产生价格差异、被跳过模型不产生价格差异、获取同步预览不写入价格配置。没有修改生产价格,也没有合并或部署。
与上游的关系 / Upstream relationship
上游参考 / Upstream reference:
OpenRouter 官方模型目录:https://openrouter.ai/api/v1/models
官方接口说明:https://openrouter.ai/docs/api/api-reference/models/list-all-models-and-their-properties
关联 Issue / Related issue
无新 Issue。已检查现有 OpenRouter PR 和相关 Issue;#417 的缺失/非有限价格拒绝行为保持不变。
变更类型 / Type of change
验证 / Verification
验证基线
de2c439f26446792d4a605b2b91fa2b84777e284加本 PR 的两文件改动;提交8b045f45f3ddd83e009478cf729d0c9d07c14afc。数据库测试使用隔离 SQLite fixture,所有命令清除 SQL_DSN、LOG_SQL_DSN、REDIS_CONN_STRING。仅本地执行,未触发远程 CI。全量测试的以下失败均在原基线重新运行并复现:
TestAssistantAdminOperationContractsMatchSourcesTestRT17ModelParserContinuityTestRT17PlaygroundGroupParserContinuityTestBI10RealRoutesRejectRotatedPATTestRT17RelayCatalogRawIdentityBoundaries未更改这些无关测试和格式问题。
just check在格式步骤停止,后续 web lint/typecheck/tests 与部署检查未通过该命令执行;本次未改 web 或部署代码。截图或日志 / Screenshots or logs
2026-10-11 对官方公开目录的 458 份模型数据做本地离线回放:原版复现
json: cannot unmarshal array into Go struct field .data.1.pricing.overrides of type string;修复版正常返回,249 个模型生成可同步的普通报价,其余保持已有校验或逐模型跳过。这个回放和 handler 测试均未调用生产写价接口。提交检查 / Checklist