Skip to content

fix(cli): bound shutdown with active SSE - #309

Merged
xingkaixin merged 1 commit into
mainfrom
feat/cs-187-sse-shutdown
Aug 11, 2026
Merged

fix(cli): bound shutdown with active SSE#309
xingkaixin merged 1 commit into
mainfrom
feat/cs-187-sse-shutdown

Conversation

@xingkaixin

Copy link
Copy Markdown
Owner

Summary

  • abort every active SSE stream when server shutdown begins
  • bound graceful HTTP shutdown and force-close lingering connections after one second
  • always shut down the scan store even if HTTP closing fails

Root cause

server.close() waited for existing connections before the store was shut down. The SSE endpoint kept its response and heartbeat alive indefinitely, so an open browser prevented the close callback and left workers and SQLite resources running.

Verification

  • added an integration test that shuts down with an attached SSE client
  • verified SSE subscriptions close before the client disconnects
  • pnpm --filter codesesh lint
  • pnpm --filter codesesh format:check
  • pnpm --filter codesesh test
  • pnpm --filter codesesh build

Issue: CS-187

@xingkaixin
xingkaixin merged commit e04d1f1 into main Aug 11, 2026
20 checks passed
@xingkaixin
xingkaixin deleted the feat/cs-187-sse-shutdown branch August 11, 2026 14:43
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