You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With xAI SuperGrok OAuth, running multiple opencode processes (or opencode + Grok CLI sharing the same OAuth client) races on the stored refresh token.
xAI rotates refresh tokens. Process A refreshes successfully and invalidates the old token; process B still holds the old refresh value and gets:
xAI token refresh failed (400): {"error":"invalid_grant","error_description":"Refresh token has been revoked"}
In-process single-flight already exists in packages/opencode/src/plugin/xai.ts, but there is no cross-process coordination on auth.json. The code even comments this as a known cross-process limitation.
Plugins
None required (built-in xAI OAuth).
OpenCode version
1.18.1
Steps to reproduce
/connect xAI Grok OAuth (SuperGrok).
Start several opencode processes against the same machine/user home (shared ~/.local/share/opencode/auth.json).
Wait until the access token is near expiry (~6h, or force by advancing system time / waiting for skew window).
Trigger LLM calls in more than one process around the same time.
Observe invalid_grant / "Refresh token has been revoked" in one or more sessions.
Screenshot and/or share link
Log excerpt:
level=ERROR message="stream error" providerID=xai modelID=grok-4.5
error="xAI token refresh failed (400): {\"error\":\"invalid_grant\",\"error_description\":\"Refresh token has been revoked\"}"
Activity
github-actions commentedon Sep 15, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.