Skip to content

Add regression test for daemon disconnect after per-turn site check#4193

Merged
sejas merged 1 commit into
trunkfrom
stu-2034-add-headless-daemon-disconnect-test
Jul 14, 2026
Merged

Add regression test for daemon disconnect after per-turn site check#4193
sejas merged 1 commit into
trunkfrom
stu-2034-add-headless-daemon-disconnect-test

Conversation

@sejas

@sejas sejas commented Jul 14, 2026

Copy link
Copy Markdown
Member

Related issues

Studio Code Desktop sessions got stuck in the "working" state after every response (STU-2034/STU-2040): a per-turn site running-state check left a daemon socket open, so the headless CLI child never exited and the UI never received the run-completion signal. #4175 fixed it by closing the socket after the check.

How AI was used in this PR

AI was used to investigate the root cause of the stuck-message bug (trace the run lifecycle and git history) and to draft the regression test. The test was reviewed and mutation-verified locally.

Proposed Changes

Add a test to avoid regressions that fails if that disconnect is ever removed again, so the same hang cannot silently return.

Testing Instructions

  • Run npm test -- apps/cli/commands/ai/tests/index.test.ts — all tests pass.
  • To confirm the test guards the regression: comment out the await disconnectFromDaemon(); line in apps/cli/commands/ai/index.ts (after the isSiteRunning check) and re-run — the new test fails.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

…TU-2034)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sejas sejas self-assigned this Jul 14, 2026
@sejas
sejas requested a review from nightnei July 14, 2026 12:08
@sejas
sejas merged commit 9d246ad into trunk Jul 14, 2026
14 checks passed
@sejas
sejas deleted the stu-2034-add-headless-daemon-disconnect-test branch July 14, 2026 12:17
@youknowriad

Copy link
Copy Markdown
Contributor

Thanks for the test :)

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.

2 participants