You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agent_ui): disable send when tool awaits confirmation (#44211)
Block message sending in the UI when a tool is awaiting confirmation
to prevent duplicate tool_use IDs error from Claude Code SDK.
Root cause hypothesis:
When a tool awaits user confirmation (e.g., ExitPlanMode in plan mode)
and the user sends a new message, Zed calls cancel() then sends the
new prompt. The Claude Code SDK's query.interrupt() interrupts execution
but appears to retain the incomplete tool_use in its internal history.
When the SDK rebuilds messages for the new request, the same tool_use ID
is included, causing the API to reject with 'tool_use ids must be unique'.
This UI fix prevents the problematic scenario by:
- Adding has_tool_awaiting_confirmation() helper method
- Blocking send() when a tool awaits confirmation
- Disabling the send button visually with informative tooltip
Users must now click Accept/Reject on tool confirmations before sending
new messages. This prevents users from losing their Claude session and
conversation context.
Fixes#44211
0 commit comments