zed/crates/acp_thread
Bruno Moreira 0a52f80824
acp_thread: Clear running_turn when prompt task drops tx (#55562)
`AcpThread::status` is purely `running_turn.is_some()`. The cleanup that
takes `running_turn` sat below the early-return guard that fires when
the prompt response oneshot resolves to `Err(Cancelled)` (the inner
`send_task` was dropped before `tx.send`). Any code path that drops the
in-flight `send_task` therefore left the panel stuck in `Generating`.
Reordered so cleanup runs before the dropped-tx guard; the same-turn
invariant is preserved.

Related to #47928 (partial — that issue also has an upstream
`claude-agent-acp` component this PR does not address).

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed agent panel staying in a generating state when the underlying
prompt task was cancelled before completing
2026-05-07 08:17:16 +00:00
..
src acp_thread: Clear running_turn when prompt task drops tx (#55562) 2026-05-07 08:17:16 +00:00
Cargo.toml Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
LICENSE-GPL Claude experiment (#34577) 2025-07-17 14:25:55 +00:00