710b604b7c
Detect authentication_failed errors from the Claude Code PTY stream and automatically refresh the OAuth access token using the stored refresh token in ~/.claude/.credentials.json. - New module server/src/llm/oauth.rs: reads credentials, calls platform.claude.com/v1/oauth/token with JSON body, writes back - PTY provider detects "error":"authentication_failed" via AtomicBool - chat_stream retries once after successful refresh - Clear error message if refresh also fails On success the retry is transparent. On failure the user sees: "OAuth session expired. Please run claude login to re-authenticate." Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>