Repository navigation
fix(go): preserve usage on cross-protocol streams - #298
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
2 similar comments
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Backport the production-relevant cross-protocol stream usage fix from QuantumNous/new-api#7389. Request upstream usage for supported streaming Gemini -> OpenAI Chat conversions and advanced-custom Claude/Gemini/Responses -> OpenAI Chat converters, while preserving non-stream, unsupported-upstream, and internal Claude staging behavior. Closes #297.
LMM API Pull Request
变更说明 / Summary
Backport the production-relevant part of QuantumNous/new-api#7389. Cross-protocol requests converted into OpenAI Chat Completions now request
stream_options.include_usage=truewhen the selected upstream supports stream options and the request is streaming.The policy is enforced at the Go host conversion facade so it consistently covers direct format conversion and explicit converter-ID routes used by advanced-custom channels. Non-stream requests and upstreams without stream-options support remain unchanged.
与上游的关系 / Upstream relationship
上游参考 / Upstream reference: QuantumNous/new-api#7389, commit
610334dbd760f1c5199a09ae5f860f11451f4c56(2026-09-15).关联 Issue / Related issue
Closes #297
变更类型 / Type of change
验证 / Verification
截图或日志 / Screenshots or logs
N/A. Backend request-conversion/billing correctness change only.
提交检查 / Checklist