Skip to content

Gateway crashes when --resume targets an expired/missing Claude CLI session #30986

@Ragingwasabi

Description

@Ragingwasabi

Bug Description

The gateway process crashes entirely when a channel's stored claudeCliSessionId references a Claude Code CLI session that no longer exists. Instead of gracefully falling back to a new session, the unhandled error takes down the whole gateway.

Steps to Reproduce

  1. Have a channel with an active CLI session (stored as claudeCliSessionId and cliSessionIds in sessions.json)
  2. Wait for the CLI session to expire/get cleaned up, or trigger a heavy task that invalidates it (in my case, filing a GitHub issue via the gh skill)
  3. Post a new message in that channel
  4. Gateway attempts --resume {sessionId}, gets "No conversation found with session ID: {id}", and crashes

Error

Agent failed before reply: No conversation found with session ID: 26161484-7b46-486c-aa83-6d020ae3433e.

The gateway process exits entirely — no recovery, no fallback. The bot goes fully offline (no typing indicator, no response in any channel including DMs).

Expected Behavior

When --resume fails with a "session not found" error, the gateway should:

  1. Clear the stale claudeCliSessionId / cliSessionIds from the session entry
  2. Start a fresh CLI session for the channel
  3. Continue operating normally

Workaround

Manually edit ~/.clawdbot/agents/main/sessions/sessions.json and delete the claudeCliSessionId and cliSessionIds fields from the affected channel entry, then restart the gateway.

Environment

  • Clawdbot version: 2026.1.24-3
  • OS: Windows 11 Pro
  • Node: 22.17.0
  • CLI backend: claude-cli with --resume / --session-id via wrapper script

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions