Repository navigation
fix: 原账号限流时保留加密代理会话并提示恢复时间 - #759
Merged
Merged
Conversation
1 of 4 tasks
19 tasks done
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.
解决的问题与行为变化
已登记归属的加密代理任务遇到原账号额度耗尽后,原先统一返回
owner_unavailable/ 409,且归属的一小时 TTL 可能早于额度恢复到期,用户缺少可操作的等待路径。owner_rate_limited/ 429、owner_overloaded/ 503。HTTP 提供Retry-After,错误说明给出 UTC 预计恢复时间及保留原会话的操作。route_changed。供应商 response/socket 的存活、真实 OAuth 配额恢复及自动换号续接尚未验证。关联记录与来源
production,45e92f44470f91435bd261ea18111c271063c0ac;head:fix/issue-758-agent-owner-recovery。提交前已从实际 base 读取CONTRIBUTING.md和 PR 模板。管理员新功能提示
NewFeatureBadge展示位置:不适用,无 UI 入口。复现与验收
openai_issue758_recovery_test.go、openai_issue758_ws_recovery_test.go、openai_issue758_recovery_wait_test.go及 service/repository retention tests。HTTP 覆盖进程内/Redis × JSON/SSE × 完整历史/previous-response;完整历史夹具为 OAuth,HTTP previous-response 夹具为 API Key,沿用端点现有限制。WS 测试仅验证初次拒绝的 loopback 错误事件与关闭码。error.type,现按既有 Responsescode/message契约修正。Redis 时钟推进不代表真实五小时等待或供应商配额恢复。协议、调度或传输改动补充
/v1/responsesHTTP JSON/SSE、WS 初次选号;模型映射不变。{"error":{"type":"rate_limit_error","code":"encrypted_agent_recovery_owner_rate_limited","message":"..."}},HTTP 429 +Retry-After。已提交 SSE 使用response.failed,不改已发响应头;WS 使用error事件和 1013 / 1008。实际验证
历史作者验证 head:
6fd9e56a609fdfbf89bba8d489a48411102203e2,在原 PR head 追加修复,没有改写历史。git diff --check、git diff --cached --checkbackend:GOTOOLCHAIN=go1.27.3 GOMAXPROCS=4 go test -p 2 -tags=unit ./internal/handler -run '^TestIssue758HTTPWaitingErrorAfterSSECommit$' -count=1 -timeout=2mbackend:GOTOOLCHAIN=go1.27.3 GOMAXPROCS=4 go test -p 2 -tags=unit ./internal/service -run '^TestIssue758(HTTPOwnerLocalRetentionPreservesTenantAndOriginalKey|HTTPOwnerRetentionRejectsLegacyAdaptersAndInvalidRequests)$' -count=1 -timeout=2mfc2c7d8b9:GREEN、lintbackend:GOTOOLCHAIN=go1.27.3 GOMAXPROCS=4 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0 run --enable-only errcheck,staticcheck --max-same-issues=0 --max-issues-per-linter=0 --new-from-rev=45e92f44470f91435bd261ea18111c271063c0ac --timeout=10m ./internal/service ./internal/repository ./internal/handler0 issues兼容性与运行影响
文档与用户可见变化
更新
docs/openai-agent-continuation.md,说明等待时间、HTTP/SSE/WS 错误形态、记录保留及 Token 刷新等剩余边界。无 UI 改动,截图不适用。Agent 使用声明
review_recovery_designretain_owner_cachehttp_recovery_regressionsci_lint_759提交前自查
追加维护修复 Agent
gpt-6.1-sol/ultra,per-run metadata 已核验;fast 仅请求值。参与 HTTP 限制前置、无等待错误与真实handler/WS对照回归,以及固定头独立复核。gpt-6.1-sol/ 推理强度未知;静态diff审查、远端发布与CI证据核验。当前修复头的远程执行验收
TestIssue758HTTPOAuthPreviousResponseCannotPromiseRecovery及四个JSON/SSE×rate/overload子例PASS(各含before/during/after三个阶段),SSE/WS错误映射对照PASS。父级下载原始log读取,未运行本地测试。