Skip to content

Add pi-coding-agent-force-idle recovery command#227

Open
jap wants to merge 1 commit into
dnouri:masterfrom
jap:issue/force-idle-command
Open

Add pi-coding-agent-force-idle recovery command#227
jap wants to merge 1 commit into
dnouri:masterfrom
jap:issue/force-idle-command

Conversation

@jap

@jap jap commented Jun 11, 2026

Copy link
Copy Markdown

Add M-x pi-coding-agent-force-idle to 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-reload is still available.

@jap

jap commented Jun 11, 2026

Copy link
Copy Markdown
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.

@jap

jap commented Jun 11, 2026

Copy link
Copy Markdown
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.
@jap jap force-pushed the issue/force-idle-command branch from 750638e to d4665d3 Compare June 11, 2026 18:16
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