Repository navigation
fix: 原账号限流或过载时继续重建可读会话 - #852
Merged
ranxi2001 merged 1 commit intoNov 14, 2026
Merged
Conversation
12 tasks done
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.
解决的问题与行为变化
开启“409 省略加密内容”后,原账号停调可以进入有损续接,但原账号处于限流或过载时仍返回
encrypted_agent_recovery_owner_rate_limited/owner_overloaded,要求等原账号恢复。周额度耗尽时会把已有会话卡住数日。将这两种本地、发送前拒绝加入现有 HTTP 可读历史重建入口。保留可读任务及已完成工具结果,清理不可移植的历史状态,再由正常调度选取可用账号。原账号冷却状态保持不变;实际已发送请求及上游返回的 429/503 不进入这个入口。
关联记录与来源
production:02c30b748944dd7a405b33f3757293d15d7a5578。dbed7697aa56e76c6eb48c4914fa441496b67bdd;最新 production 仍有相同原因白名单限制。未导出或重放真实用户请求。管理员新功能提示
NewFeatureBadge位置:不适用,本次修复已有开关,无新入口。复现与验收
使用虚构任务、隔离 Redis 与 localhost 假上游:A 完成交付带 opaque 历史的响应和工具调用;记录一次已执行的工具结果后,将 A 置为未来七天限流或过载,继续同一客户端会话。
旧行为:本地 429/503,B 没有收到请求。
验收标准:开启开关后,B 收到一次重建后的请求并完成后续工具轮次,原任务、工具参数/结果/ID/顺序保留,补丁和验证工具各执行一次;A 冷却及 owner 记录不变。
openai_409_omit_history_test.go(handler):429/503 开关开启与关闭、不可读当前任务、无可用账号,覆盖 JSON/SSE。openai_409_http_rebuild_test.go:API Key/OAuth × JSON/SSE × 限流/过载,使用现有完整工具续轮 fixture。openai_409_omit_history_test.go(service):重建后出现 pending/failed/conflict 交付状态,发送前仍拒绝。协议、调度或传输改动补充
/v1/responses;API Key/OAuth;JSON/SSE;沿用原模型映射和权限校验。Retry-After。新账号仍检查余额、额度、权限、模型及并发;没有可用账号不会伪造成功。实际验证
git diff --checkbackend中go test -race -tags=unit ./internal/service ./internal/handler ./internal/handler/admin -run '^Test(OmitOpenAIHistorical|OpenAI409|UpdateSettingsOpenAI409)' -count=1 -v -timeout=5m190e3c6f8ad37f2ad1c2babaebcf1b62b8f67d70;已回读 protocol job,新增 8 种完整工具续轮、16 种冷却边界、6 种后续交付屏障叶用例全部 PASS兼容性与运行影响
openai_409_omit_encrypted_history_enabled,默认关闭;只改变已开启时的发送前冷却拒绝处理。文档与用户可见变化
更新
docs/encrypted-history-409-beta.md,明确 HTTP 原账号冷却也可续接,以及它与已发送请求的区别。没有 UI 改动,截图不适用。源码合并不代表发布或上线。Agent 使用声明
提交前自查