Add pi-coding-agent-force-idle recovery command#227
Open
jap wants to merge 1 commit into
Open
Conversation
Author
|
Just adding some human input here, as I had pi/qwen3.6 create this PR. I ran into the issue that after a long-running prompt with some steering, followed by compacting, pi-coding-agent.el would get stuck in "thinking" instead of the actual idle. This happened multiple times so I decided to scratch the itch. 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 helper function. After some rounds of eval-buffer, I was able to execute this in the context of a stuck session, and it did what it promises on the thin. I hope it may be of use. |
Author
|
Oh shucks it included the fix from #226, let me do some rebasing. |
When the session gets stuck (e.g., status stuck at "thinking" after compaction or retry), M-x pi-coding-agent-force-idle resets the local status back to idle, cancels pending timers, and restores any queued follow-ups to the input buffer.
750638e to
d4665d3
Compare
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.
Add
M-x pi-coding-agent-force-idleto manually reset a stuck session back to idle.Resets status and activity-phase, cancels pending timers (follow-up drain, prompt-start wait), clears pre-compaction state, and restores any queued follow-ups to the input buffer.
Does not kill the pi process — if the server is still processing it may send events that override the reset. For full recovery,
pi-coding-agent-reloadis still available.