[BUG] 600-second timeout in webview silently drops saved session ID on panel restore

Resolved 💬 8 comments Opened Mar 16, 2026 by BoostlyPeter Closed Apr 30, 2026

Description

The VS Code extension webview applies a 10-minute (600-second) expiry to the session ID saved in panel state. If the panel's last activity was more than 10 minutes before VS Code is closed (or before the next restart), the saved session ID is silently discarded and the panel opens a blank new session.

This affects all platforms.

Root Cause

In webview/index.js, the saved session state is read with a time cutoff:

// Current:
if (Z.value.sessionID) {
  if (Z.value.sessionUpdatedAt === void 0 || Date.now() - Z.value.sessionUpdatedAt < 600000)
    j = Z.value.sessionID
}

// Should be:
if (Z.value.sessionID) {
  j = Z.value.sessionID
}

sessionUpdatedAt is the timestamp of the last update_session_state message from the CLI. In normal use — finishing a conversation, leaving VS Code open while doing other work, then closing — the panel's session will frequently be older than 10 minutes by the time VS Code is closed and later reopened.

Steps to Reproduce

  1. Open VS Code with a Claude Code panel tab
  2. Have a conversation, then stop chatting
  3. Wait more than 10 minutes without sending any messages
  4. Close VS Code
  5. Reopen VS Code — panel opens a blank new session despite having a valid saved session ID

Expected Behavior

A saved session ID should be honoured unconditionally on restore. The 10-minute window has no clear rationale for a session-restore use case — sessions on disk are valid indefinitely and getSession() handles missing sessions gracefully. The timeout only causes false negatives (valid sessions being dropped), never prevents a real problem.

Impact

In practice this timeout silently breaks restore for the majority of real-world usage patterns:

  • Any conversation that ended before closing VS Code
  • Any overnight close/reopen cycle
  • Any workspace left idle before the end of the day

The failure is completely silent — no log message, no fallback — so users have no indication their session was dropped due to a timeout rather than a missing file.

Environment

  • Confirmed on v2.1.74 and v2.1.76
  • Affects all platforms
  • Panel tabs only (sidebar uses a different restore path)

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗