Skip to content

fix(acp): wait for settled prompt after Stop; skip SESSION_BUSY auto-retry#1093

Open
metalmon wants to merge 1 commit into
thunderbird:mainfrom
metalmon:fix/acp-stop-busy
Open

fix(acp): wait for settled prompt after Stop; skip SESSION_BUSY auto-retry#1093
metalmon wants to merge 1 commit into
thunderbird:mainfrom
metalmon:fix/acp-stop-busy

Conversation

@metalmon

@metalmon metalmon commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • After Stop, await the in-flight session/prompt to settle before starting another prompt on the same ACP session, so a quick follow-up send does not race the agent's still-busy turn slot.
  • Treat ACP "active prompt turn" / SESSION_BUSY errors as non-retryable in chat auto-retry (same idea as rate limits), so blind retries do not amplify the race.

Fixes #1094

Context

Stop already sends session/cancel and tears down the local SSE stream. Some ACP agents (e.g. Zeroclaw) only clear the busy slot when the cancelled turn fully exits. The UI becomes free immediately, so the next message can hit Session already has an active prompt turn and auto-retry makes it worse.

Test plan

  • bun test src/acp/acp-adapter.test.ts src/lib/error-utils.test.ts
  • Stop mid-turn on a remote ACP agent, then send again once the prior prompt has settled — no SESSION_BUSY / active-prompt-turn error from racing the next session/prompt
  • If SESSION_BUSY still surfaces (slow agent cleanup), confirm chat does not auto-retry in a loop

…retry

Prevent racing a new session/prompt onto a still-busy ACP slot after cancel, and stop blind chat retries that amplify Zeroclaw's active-turn reject.
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.

ACP: Stop then quick send can hit SESSION_BUSY / active prompt turn

1 participant