Skip to content

[feature] Repair hosted authentication in the console without losing the task #277

Closed

Description

@AetherAI3

Problem

When automatic refresh cannot repair a hosted 401, the terminal offers aether auth login as a hint. The user must leave the conversation flow or run a separate command, then reconstruct which prompt failed and whether any work occurred. Existing draft recovery helps but does not provide a guided in-session repair.

Evidence: src/core/errors.ts, src/core/transport.ts, and src/commands/chat.ts. Automatic refresh already exists; this request starts after that recovery fails.

Proposed outcome

Provide a small /auth status/login repair flow in the coding/chat console using the existing login implementation. Keep the draft and submitted task available. After same-account sign-in succeeds, refresh the account model catalogue and offer an explicit continuation of the failed task.

Constraints and alternatives

Retain browser and no-browser login paths, credential-source diagnostics, and timeouts. An environment-provided token can override a stored login: explain that source without showing token bytes or silently changing the environment. Login itself must not consume a model call.

Differentiate 401 from balance/model entitlement failures, rate limits, and network errors. A 402/403 must not become an endless sign-in loop. An account change requires an explicit choice about starting a new conversation. Do not replay completed tools or resend a turn whose acceptance is uncertain.

Acceptance

  • An expired credential with failed refresh produces one clear repair action; cancelling or timing out login leaves the draft and workspace intact.
  • Successful same-account login returns to the console and lets the user resume with the original instruction and known work receipts.
  • A newer type-ahead draft is preserved separately from the failed submission.
  • Credential override, API-key mode, headless login, account switch, offline API, and 402/403/429 have truthful, distinct outcomes.
  • Tests count zero model calls during repair and zero repeated file/shell side effects when returning to the task.

Priority: P1. Core hosted coding UX. Source reviewed at ca4180d (0.4.0 candidate). This ticket is an implementation spec; live service qualification remains separate.

Activity

  1. AetherAI3 commented on Oct 6, 2026

    @AetherAI3
    OwnerAuthor

    Implemented and closed by Aether-Agent PR #296 (merged as b51505c) and AETHER-CLOUD PR #1935 (merged as b2b700f).

    Acceptance evidence:

    • The console now has /auth status, /auth login, /auth continue, /auth new, and /auth draft. It keeps the failed instruction apart from a newer type-ahead draft and reports credential source without token bytes. Browser, --no-browser, and existing standalone headless login paths remain available.
    • The authenticated model catalog now returns an optional opaque account_id. The console refreshes it after login and offers continuation only when the prior and new account IDs match. Different or unknown identity requires an explicit new conversation. Older servers safely omit the field.
    • A rejected HTTP 401 with no observed work receipts can be continued once, only by /auth continue. Streamed/ambiguous work and known tool receipts cannot be blindly replayed. HTTP 402/403/429, balance reported as 401, API key rejection, environment override, and network failure have distinct outcomes.
    • Focused Windows build and tests: 102 passed. Independently on Linux (Node 24.21.0): build and the same 102 tests passed. The console integration test observes zero model calls during login, one model call only after explicit continuation, and zero repeated file/shell side effects. Cloud route tests: 2 passed. Generated command documentation check passed.

    GitHub Actions for the Agent PR did not execute: the failed job annotations say, "The job was not started because your account is locked due to a billing issue" (example: https://github.com/AetherAI3/Aether-Agent/actions/runs/37476586950/job/112313475394). The independent platform tests above replace those unavailable checks for this change. Live hosted service qualification remains separate as specified in the issue.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions