Skip to content

improve(auth): make session recovery state and next action explicit #235

Open

Description

@KalebCole

Problem

An expired access token can look like a full logout even when a stored refresh token can recover the CLI session. That ambiguity sent a real event workflow into an unnecessary browser-login path.

Goal

Make the CLI's credential state and next recovery action obvious before a user starts a new phone-code login.

Suggestions

  • Let diagnostics distinguish missing credentials from an expired access token with a refreshable session.
  • Let auth status say whether it refreshed credentials during the check.
  • Make the normal login entry point try ordinary session recovery first; retain an explicit forced reauthentication path.
  • Keep behavior clear in the JSON contract and user documentation.
  • Keep the existing manual private-terminal login flow working on every supported platform.

Acceptance criteria

  • A user can tell whether auth status recovered an expired session.
  • A user is directed to a fresh SMS login only when recovery cannot work.
  • The normal manual path remains supported and tested.
  • Tests cover missing, healthy, expired-but-refreshable, expired-and-unrecoverable, and forced-reauth states.

Non-goals

  • Browser-session synchronization.
  • SMS-code automation.
  • Changing token storage format or exposing credential material.

Activity

  1. added
    enhancement
    on Sep 15, 2026
  2. KalebCole commented on Nov 14, 2026

    @KalebCole
    OwnerAuthor

    Triage bot: held for Kaleb. Clearer recovery state fits the agent-native bar (errors say what went wrong and what to do next), but changing auth status or error envelopes changes goldens, which need his review.

  3. added
    held
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementheld

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions