Conversation
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.
概要
背景
Grok Build 账号一旦因
invalid_grant等错误被标记为永久失效,原逻辑会直接阻止后续刷新。这对自动任务是合理的,但也导致管理员点击手动刷新时无法真正请求上游。即使 Refresh Token 已在上游恢复,或此前状态判断已经过时,也只能继续看到旧错误。
修改内容
手动强制重试
以下管理员操作会绕过永久失败状态一次:
具备 Refresh Token 的启用账号都会参与刷新,包括状态为“失效”的账号;缺少 Refresh Token、已停用或 Provider 不支持刷新的账号仍会跳过。
自动链路保持保护
以下链路不会绕过永久失败状态:
因此不会因为本次修改持续请求已经确认失效的 Refresh Token。
并发隔离
手动重试使用独立的 singleflight 标识,与自动刷新任务隔离,同时继续复用账号级分布式锁,避免多实例重复刷新。
状态处理
用户影响
管理员可以通过手动刷新验证失效凭据是否已经恢复,无需重新导入账号。
自动任务的保护行为保持不变,不会增加永久失效凭据的后台请求压力。
验证
以上检查全部通过。