fix: Connect sometimes gets stuck in "connected" state without starting a session #166

Closed
opened 2026-02-25 11:09:57 -08:00 by hikari · 0 comments
Owner

Description

Occasionally, clicking the Connect button results in the status bar showing "Connected to Claude Code" but no session ever starts — the thinking sprite never appears and Claude never responds. The app is stuck in a connected-but-inactive state.

Steps to Reproduce

  1. Click the Connect button
  2. Observe status changes to "Connected to Claude Code"
  3. No thinking animation plays, no session initialises, no greeting appears
  4. The UI is unresponsive to prompts

Expected Behaviour

After connecting, Claude should initialise a session, the thinking sprite should appear briefly, and a greeting message should be sent.

Likely Causes

  • The underlying start_claude command succeeds (process spawns) but the process exits immediately without emitting the system init message — so the frontend thinks it's connected but the stream is dead
  • A race condition between the process spawning and the frontend beginning to listen for events
  • The Claude CLI process may be failing silently (e.g. auth error, missing config) without surfacing an error back through the stream

Suggested Investigation

  • Check whether the Claude process is actually running after the stuck state occurs
  • Add error handling for the case where the stream ends without ever receiving a system init message — surface this to the user rather than leaving the UI stuck
  • Check WslBridge for silent failure paths where the child process exits but no error event is emitted to the frontend

This issue was created with help from Hikari~ 🌸

## Description Occasionally, clicking the Connect button results in the status bar showing "Connected to Claude Code" but no session ever starts — the thinking sprite never appears and Claude never responds. The app is stuck in a connected-but-inactive state. ## Steps to Reproduce 1. Click the Connect button 2. Observe status changes to "Connected to Claude Code" 3. No thinking animation plays, no session initialises, no greeting appears 4. The UI is unresponsive to prompts ## Expected Behaviour After connecting, Claude should initialise a session, the thinking sprite should appear briefly, and a greeting message should be sent. ## Likely Causes - The underlying `start_claude` command succeeds (process spawns) but the process exits immediately without emitting the `system` init message — so the frontend thinks it's connected but the stream is dead - A race condition between the process spawning and the frontend beginning to listen for events - The Claude CLI process may be failing silently (e.g. auth error, missing config) without surfacing an error back through the stream ## Suggested Investigation - Check whether the Claude process is actually running after the stuck state occurs - Add error handling for the case where the stream ends without ever receiving a `system` init message — surface this to the user rather than leaving the UI stuck - Check `WslBridge` for silent failure paths where the child process exits but no error event is emitted to the frontend ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-02-25 22:55:48 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#166