# open_ai: Trim newline before "data:" prefix and account for the possibility of no space after ":" \(\#37644\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7091c70a1e200e5093a726bc573f23cd7d2a2fce

Requested commit: 7091c70a1e200e5093a726bc573f23cd7d2a2fce

Commit: 7091c70a1e200e5093a726bc573f23cd7d2a2fce

Tree: cda797b9a5a2502e614f859faac84b6eec573eb7

Author: ZhangJun

Committer: GitHub

## Message

```
open_ai: Trim newline before "data:" prefix and account for the possibility of no space after ":" (#37644)

I'am using an openai compatible model, but got nothing in agent thread
panel, and Zed log has "Model generated an empty summary" line.

I add one log to open_ai.rs:
<img width="2454" height="626" alt="图片"
src="https://github.com/user-attachments/assets/85354c7d-a0cc-4bba-86fd-2a640038a13e"
/>

and got:

<img width="3456" height="278" alt="图片"
src="https://github.com/user-attachments/assets/7746aedd-5d76-44b5-90f2-e129a1507178"
/>

It appear that `let line = line.strip_prefix("data: ")?;` can not handle
correctly.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
```

## Parents

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

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