Fix stuck 'thinking' status after compaction or agent-end retry#226
Open
jap wants to merge 1 commit into
Open
Conversation
After compaction_end with willRetry=true (or agent_end with willRetry), status is set to 'sending' and activity-phase to 'thinking', awaiting agent_start or auto_retry_start. The prompt-start-wait fallback timer (0.5s → idle) was only scheduled for user-sent prompts; server-initiated retries had no fallback. If the server never sends the expected event, the session remains stuck indefinitely. Call --begin-prompt-start-wait when status becomes 'sending' after compaction_end and agent_end, so the existing 0.5s fallback resets to idle if no agent_start/auto_retry_start arrives.
Author
|
Just adding some human input here, as I had pi/qwen3.6 create this PR :) I told another instance of pi-coding-agent.el about this bug, pointed it to this repo, and then after some back and forth it created this fix. I haven't run any long-running prompts that tended to get stuck yet, so caveat emptor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After
compaction_endwithwillRetry=true(oragent_endwithwillRetry), status is set tosendingand activity-phase to"thinking", awaitingagent_startorauto_retry_start.The
--prompt-start-waitfallback timer (0.5s → idle) was only scheduled for user-sent prompts. Server-initiated retries had no fallback, so if the server never sends the expected event, the session remains stuck indefinitely.Fix: Call
--begin-prompt-start-waitwhen status becomessendingaftercompaction_endandagent_end. The existing 0.5s fallback resets to idle if noagent_start/auto_retry_startarrives. Applied in both--handle-compaction-end-eventand--display-agent-end.