Retain user input after OAuth token expiration and re-login

Resolved 💬 2 comments Opened Feb 16, 2026 by kitaekatt Closed Mar 21, 2026
Note: Re-filing of #17716, which is being auto-closed due to inactivity. The issue still exists.

Problem

When an OAuth token expires mid-session, the user's input that triggered the 401 error is lost after running /login. The user must manually retype or copy-paste their original message, creating unnecessary friction.

Example

❯ i have synced to a specific changelist, validate this
  ⎿  API Error: 401 {"type":"error","error":{"type":"authentication_error",
     "message":"OAuth token has expired. Please obtain a new token or refresh
     your existing token."},"request_id":"req_011CX3jv5Mv7L1DxjBpfWYwK"}
     · Please run /login

❯ /login
  ⎿  Login successful

❯ i have synced to a specific changelist, validate this

The user had to retype the exact same input after re-authenticating.

UX Impact

The user must retype or copy-paste what they've already typed, creating friction in an otherwise smooth re-authentication flow. For long or complex prompts, this is especially painful.

Proposed Solutions

Either approach would address this:

  1. Tab auto-complete: After successful /login, offer the failed input as a tab-completion suggestion
  2. History buffer: Store the failed input in the up-arrow command history so it's immediately accessible

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗