Skip to content

fix(usage): preserve max reasoning effort for GPT-6 Astra - #6611

Closed
QiuZhiFei wants to merge 1 commit into
Wei-Shaw:mainfrom
QiuZhiFei:main
Closed

QiuZhiFei wants to merge 1 commit into
Wei-Shaw:mainfrom
QiuZhiFei:main

Conversation

@QiuZhiFei

@QiuZhiFei QiuZhiFei commented Sep 4, 2026 •

Copy link
Copy Markdown

Summary

  • 使用 gpt-6-astra 请求 reasoning.effort=max 时,API Key 透传的请求体保留 max,但用量元数据被归一化成 xhigh,导致使用记录误显示 Max → XHigh。原因是 supportsOpenAIReasoningEffortMax 未识别 Astra。
  • 将 gpt-6-astra 及以 gpt-6-astra- 分隔的后缀变体纳入独立 max 档位识别,复用现有的提供商前缀、大小写和下划线处理。普通 Astra 请求的记录由 requested=max / effective=xhigh 变为 requested=max / effective=max。
  • 新增 8 个名称/档位边界用例,以及普通模型名、映射别名分别在流式和非流式 API Key 透传中的 4 个回归场景;同时断言上游请求体与用量结果中的 effort。

Testing

  • git diff --cached --check:通过。
  • gofmt -l backend/internal/service/openai_gateway_request_body.go backend/internal/service/openai_gpt6_max_test.go:无输出,格式检查通过。
  • 已完成完整差异与相关调用路径的代码审查。
  • 按本次提交工作流,未在本地执行 Go 测试或构建;新增回归用例交由 PR CI 的 unit/integration 测试与 golangci-lint 检查。用例不会调用真实上游服务。

Risks

  • 仅新增 Astra 的 max 识别;其他模型既有的 max → xhigh 兼容行为、分组上限/映射规则保持现状。没有数据库迁移,历史记录不会回写。
  • 本次未部署生产服务,修复需合入并更新运行版本后生效。
  • 与尚未合并的 feat(openai): complete GPT-6 Astra support #6572 中 Astra max 识别部分重叠。本 PR 提供独立的记录修复和透传回归用例;若优先合入 feat(openai): complete GPT-6 Astra support #6572,可复用相关用例并关闭本 PR,避免重复维护。

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign, please reply with the following comment:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once — it will be valid for all your future contributions to this project.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant