Skip to content

fix: retry pre-output budget exhaustion events - #8005

Open
HUANGDEHUANG wants to merge 1 commit into
Wei-Shaw:mainfrom
HUANGDEHUANG:upstream-fix/pre-output-budget-retry
Open

HUANGDEHUANG wants to merge 1 commit into
Wei-Shaw:mainfrom
HUANGDEHUANG:upstream-fix/pre-output-budget-retry

Conversation

@HUANGDEHUANG

Copy link
Copy Markdown

Problem

Some OpenAI-compatible upstreams return an HTTP 200 stream that immediately contains an error event with Upstream pre-output time budget exhausted. Because the wire status is 200 and the message was not classified as transient, the gateway could pass the failure to clients instead of retrying before any semantic output.

Change

Classify this specific pre-output budget exhaustion message as replayable in openAIStreamErrorEventShouldFailover. The existing failover loop then retries/switches accounts only while no client-visible semantic output has been sent. Non-transient request and policy errors remain unchanged.

Validation

  • Added a regression test covering the HTTP 200 error event shape.
  • git diff --check passes.
  • The repository service test package currently has unrelated existing compile failures for missing test helpers (reasoningRecordingCache, rawChatCompletionsTestAccount, etc.).

@github-actions

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


Codex seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@HUANGDEHUANG

Copy link
Copy Markdown
Author

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

1 similar comment
@HUANGDEHUANG

Copy link
Copy Markdown
Author

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

riofutab added a commit to riofutab/sub2api that referenced this pull request Oct 14, 2026
riofutab added a commit to riofutab/sub2api that referenced this pull request Oct 14, 2026
- OpenAI/Codex 稳定性:OAuth 缺过期时间时按 JWT 判定并在 WS 上恢复 401(Wei-Shaw#8034,替换 fork 原有的 Wei-Shaw#7826 实现)、模型拒绝不计入调度错误率(Wei-Shaw#8013)、首包前预算耗尽换号(Wei-Shaw#8005)、Sol 别名误判修正(Wei-Shaw#8063)
- 流与协议:原生 Claude 转 Chat 转发心跳(Wei-Shaw#8052)、Codex 流式出图兼容 JSON 响应(Wei-Shaw#8028)、Antigravity 工具结果图片(Wei-Shaw#8045)
- 用量显示:5h 换窗保留未到期周额度(Wei-Shaw#7990)、缓存命中率口径修正与单次命中率显示(Wei-Shaw#8018、Wei-Shaw#7995)

测试:go test -tags=unit ./... 全部通过,golangci-lint 0 issues;前端 make test-frontend 通过;集成测试交 CI。
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