# Move language model stream mapping to background executors \(\#63241\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5ed5bf95e518f1b35386a8787b512c99b90509f7

Requested commit: 5ed5bf95e518f1b35386a8787b512c99b90509f7

Commit: 5ed5bf95e518f1b35386a8787b512c99b90509f7

Tree: 12758d2b11c4c873a206befba8deb2ab52853dd3

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
Move language model stream mapping to background executors (#63241)

Language model event mappers run as part of lazy completion streams.
Because these streams are polled on the main thread, repairing and
parsing large streamed tool inputs can freeze the UI.

This moves completion stream mapping to background executors. A bounded
channel preserves event order and backpressure, while dropping the
stream cancels its background task. The change covers all providers that
perform this work.

Release Notes:

- Fixed UI hangs when language model providers stream large tool inputs.
```

## Parents

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

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