新增grok切号,自动同步opencode鉴权信息的选项 - #2002
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0556fda9d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Ok(json!({ | ||
| "type": "oauth", | ||
| "access": access, | ||
| "refresh": refresh, | ||
| "expires": grok_expires_ms(account), |
There was a problem hiding this comment.
Reconcile rotated xAI refresh tokens
When OAuth syncing is enabled, this copies the same rotating refresh-token chain into OpenCode, but Cockpit's refresh recovery only adopts credentials from its store, managed Grok home, and official Grok home (grok_account.rs::refresh_credentials), never from OpenCode. Once either OpenCode or Cockpit refreshes an expired token, the other retains the invalidated refresh token; a later Grok switch can even overwrite OpenCode's newer credentials with that stale chain, causing invalid_grant/401 failures. Include OpenCode auth in the guarded credential reconciliation or propagate rotations in both directions before sharing this refresh token.
Useful? React with 👍 / 👎.
代码已人工reivew,i18n是AI自动翻译的。
新增grok切号同步opencode鉴权,结果如图,已人工测试通过。
