Skip to content

bug: stale session ID causes 'No conversation found' on task open #90

@wise-toddler

Description

@wise-toddler

Bug

When opening a task, Claude Code fails with:

No conversation found with session ID: d55325cb-edb0-43c5-b199-e45b18417b87
Process exited with code 0

This happens because the conversationId stored in tasks.provider_config becomes stale — Claude Code cleans up old sessions on updates/restarts, but SlayZone keeps the old ID and tries claude --resume {stale-id}.

Affects most tasks after a Claude Code update or after enough time passes.

Root Cause

provider_config["claude-code"].conversationId in SQLite persists a session UUID. Claude Code sessions are ephemeral — they get garbage-collected. SlayZone has no way to know the session is gone until it tries to resume and fails.

The existing handleSessionInvalid recovery (TaskDetailPage.tsx:620) clears the ID and kills the PTY, but:

  • The process often exits before the error handler fires
  • User loses context with no option to reconnect

Expected Behavior

When SlayZone detects a session ID mismatch (stored ID ≠ actual running session, or stored session no longer exists):

  1. Detect the mismatch on task open
  2. Show a clear indicator that the session is stale
  3. Offer actionable options — e.g. "Start fresh session" / "Pick existing session to link"
  4. Update provider_config with the correct session ID so future opens work

Current Behavior

  • Task opens → "No conversation found" error → process exits → dead terminal
  • User has to manually figure out what happened
  • No way to link a task to a different existing session from the UI

Relevant Code

File What
claude-adapter.ts:39 Detects No conversation found in PTY output
TaskDetailPage.tsx:620 handleSessionInvalid — clears stale ID, kills PTY
Terminal.tsx:769 Subscribes to subscribeSessionInvalid
pty-manager.ts subscribeSessionDetected exists for Codex — could extend for Claude
tasks.provider_config JSON column storing conversationId per mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions