Skip to content

Use idle session state as end of turn#463

Merged
benbrandt merged 2 commits intomainfrom
switch-to-session-state-events
Mar 25, 2026
Merged

Use idle session state as end of turn#463
benbrandt merged 2 commits intomainfrom
switch-to-session-state-events

Conversation

@benbrandt
Copy link
Copy Markdown
Member

According to the type docs, this should be a more reliable indicator of
turn end:

Mirrors notifySessionStateChanged. 'idle' fires after heldBackResult
flushes and the bg-agent do-while exits — authoritative turn-over
signal.

According to the type docs, this should be a more reliable indicator of
turn end:

> Mirrors notifySessionStateChanged. 'idle' fires after heldBackResult
  flushes and the bg-agent do-while exits — authoritative turn-over
  signal.
@cla-bot cla-bot bot added the cla-signed label Mar 25, 2026
@benbrandt benbrandt merged commit 7f1c6c2 into main Mar 25, 2026
2 checks passed
@benbrandt benbrandt deleted the switch-to-session-state-events branch March 25, 2026 21:50
SteffenDE added a commit to SteffenDE/claude-code-acp that referenced this pull request Mar 26, 2026
SteffenDE added a commit to SteffenDE/claude-code-acp that referenced this pull request Mar 26, 2026
SteffenDE added a commit to SteffenDE/claude-code-acp that referenced this pull request Mar 26, 2026
SteffenDE added a commit to SteffenDE/claude-code-acp that referenced this pull request Mar 26, 2026
benbrandt added a commit that referenced this pull request Mar 26, 2026
#463 introduced a problem with cancelling prompts. Because cancel exited
the loop early, the idle session state message was not consumed. Then,
in the next prompt, we'd immediately get the idle state and assume it's
done.

Instead, we always wait for the idle state (and still finish early when
detecting a queued prompt).

Note that this is based on my tests that showed Claude only sending the
idle state when all background agents are done.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
benbrandt pushed a commit that referenced this pull request Mar 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.24.1](v0.24.0...v0.24.1)
(2026-03-26)


### Bug Fixes

* Cleanup based on new idle state
[#463](#463)
([#480](#480))
([23b3073](23b3073))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant