# agent: Add ability to queue messages \(\#46019\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/69ecd31b02cb587b1b627702e7deeb8a0709fe49)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 69ecd31b02cb587b1b627702e7deeb8a0709fe49

Requested commit: 69ecd31b02cb587b1b627702e7deeb8a0709fe49

Commit: 69ecd31b02cb587b1b627702e7deeb8a0709fe49

Tree: ceed15f30b0f5667f89cf725b05145fcb9929d96

Author: Danilo Leal

Committer: GitHub

## Message

```
agent: Add ability to queue messages (#46019)

Closes https://github.com/zed-industries/zed/issues/37905
Closes https://github.com/zed-industries/zed/discussions/42338
Closes https://github.com/zed-industries/zed/discussions/33501
Closes https://github.com/zed-industries/zed/discussions/41414

This PR introduces a way to queue messages in the agent panel through
the `cmd-shift-enter` keybinding. Queued up messages get sent as soon as
the current generation wraps up. It's also possible to send a queued
message before time, effectively interrupting the ongoing generation.
You can also clean up the entire queue through another keybinding. Then,
if you normally interrupt the thread and if there are queued up
messages, those will get sent as soon as the interruption generation
wraps up. Lastly, if you queue up a message with an idle thread, that's
sent immediately, given that there can never exist a "stuck queue" with
this implementation.


https://github.com/user-attachments/assets/54e68d95-5abb-477c-aecb-9325dcb99175

Release Notes:

- agent: Added the ability to queue messages in the agent panel.
```

## Parents

- [c32a811b4ef9c1d1d5869a42c00c0a2bc249d342](https://git.cafe/gitcafe/zed/commit/c32a811b4ef9c1d1d5869a42c00c0a2bc249d342?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/69ecd31b02cb587b1b627702e7deeb8a0709fe49?format=markdown)
