feat: auto-refresh expired OAuth token for Claude Code PTY (story 405)
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>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
pub mod chat;
|
||||
pub mod oauth;
|
||||
pub mod prompts;
|
||||
pub mod providers;
|
||||
pub mod types;
|
||||
|
||||
Reference in New Issue
Block a user