Skip to content

feat: auto-exit CLI on session archive#943

Open
chaehyun2 wants to merge 1 commit intoslopus:mainfrom
chaehyun2:feat/archive-auto-exit
Open

feat: auto-exit CLI on session archive#943
chaehyun2 wants to merge 1 commit intoslopus:mainfrom
chaehyun2:feat/archive-auto-exit

Conversation

@chaehyun2
Copy link
Copy Markdown

Summary

  • When a session is archived from web or mobile, the CLI process now detects the lifecycleState change and automatically exits
  • Listens for metadata updates in apiSession.ts — emits archived event when archiveRequested or archived state is detected
  • runClaude.ts listens for archived event and calls cleanup() to gracefully terminate

Problem

Previously, archiving a session from web/mobile left the CLI process running as a zombie. These accumulated over time and could cause resource exhaustion (TCP connections, memory, even kernel panics from network interface ref count overflow).

Test plan

  • Archive session from web UI → CLI process exits
  • Normal session usage unaffected
  • Only applies to sessions started after the update

🤖 Generated with Claude Code

Listen for lifecycleState changes in metadata updates. When
archiveRequested or archived is detected, emit 'archived' event
and trigger cleanup to kill the CLI process.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
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