Skip to content

fix #55: preserve Claude sessions across app updates#94

Open
blueberrycongee wants to merge 1 commit intomainfrom
fix/issue-55-sessions-lost-after-update
Open

fix #55: preserve Claude sessions across app updates#94
blueberrycongee wants to merge 1 commit intomainfrom
fix/issue-55-sessions-lost-after-update

Conversation

@blueberrycongee
Copy link
Owner

Summary

  • Session ID persistence: updateTerminalSessionId now calls markDirty(), triggering auto-save so session IDs survive force-kill scenarios. Previously, session IDs were only persisted on explicit save or graceful quit.
  • Pre-launch validation: New session:validate IPC checks whether a session's JSONL file still exists on disk before attempting --resume. If the file is gone (e.g. cleaned up by Claude CLI during update), the terminal starts fresh immediately with a clear message instead of failing with "No conversation found".
  • Cleaner UX: Instead of the confusing error → exit → respawn cycle, users see "[Previous session no longer available, starting fresh...]" upfront.

Test plan

  • Start Claude session, capture session ID, force-quit app (kill process), relaunch — session should resume
  • Delete a Claude session JSONL file manually, relaunch — should see "starting fresh" message, no error
  • Normal quit + relaunch — sessions resume as before
  • Codex session validation path works similarly

Three changes to prevent session loss during force-kill updates:

1. Mark workspace dirty when session IDs change so auto-save persists
   them to disk. Previously updateTerminalSessionId did not trigger
   auto-save, so a force kill before manual save lost all session IDs.

2. Add session:validate IPC that checks whether a session's JSONL file
   still exists on disk before attempting --resume. This avoids the
   confusing error-then-respawn flow when Claude CLI's session data was
   cleaned up during an update.

3. In TerminalTile, validate sessions proactively at launch. If the
   session file is gone, start fresh immediately with a clear message
   instead of letting the CLI fail with "No conversation found".
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant