#1791·happy

Remote Claude sessions stay connected but repeatedly fail after host OAuth expires

Author: f-livaCreated Sep 14, 2026Updated Sep 14, 2026

Summary

Happy remote Claude sessions remain online and accept prompts when the Claude Code OAuth login on the host has expired, but every prompt then returns only:

Failed to authenticate: OAuth session expired and could not be refreshed

The Happy daemon itself reports that it is using existing credentials, which refers to Happy authentication, while the separate Claude provider authentication is unusable. From the mobile client this distinction is unclear and the session appears connected but permanently broken.

Environment

  • Happy CLI 1.2.2
  • Claude Code bundled by the Agent SDK: 2.1.260
  • System Claude Code: 2.1.270
  • Linux / WSL
  • Remote sessions started by the Happy daemon
  • Custom Anthropic endpoint inherited through ANTHROPIC_BASE_URL=http://localhost:<port>

Reproduction

  1. Start the Happy daemon and create a remote Claude session.
  2. Allow the canonical Claude Code OAuth credentials in ~/.claude/.credentials.json to expire or become unusable.
  3. Confirm on the host that claude auth status --json reports loggedIn: false.
  4. Send a prompt from Happy mobile.

Actual behavior

The session accepts and dequeues each prompt, then returns the OAuth error in under a second. Repeated prompts produce the same result while the Happy session remains online.

The child process correctly inherits ANTHROPIC_BASE_URL; this is not a proxy bypass. Claude Code fails its local authentication gate before making an HTTP request, so the configured endpoint never receives the prompt.

Running claude auth login on the host restores operation through the same unchanged Happy session and endpoint.

Expected behavior

Happy should identify provider authentication failure as a host-side setup problem and expose an actionable state instead of leaving a connected session that repeatedly consumes prompts.

Possible improvements:

  • Before launching or resuming a Claude remote session, run an authentication preflight using the same bundled Claude binary and config directory.
  • Show a specific mobile/remote error such as: Claude Code login expired on the host. Run claude auth login.
  • Clearly distinguish Happy account authentication from Claude provider authentication.
  • Retry or relaunch the Claude child after the host login becomes valid again.

For custom base URLs, the message should also explain that the failure occurred before any request reached the configured endpoint.

Related upstream behavior

The proxy-side aspect is tracked separately in KarpelesLab/teamclaude#395. This issue is about Happy's detection and presentation of the host Claude authentication failure, independent of the proxy implementation.