[BUG] Native OpenAI sync streaming with response_model returns an empty string and emits no completed event when the parse is missing
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
阅读 lib/crewai/src/crewai/llms/providers/openai/completion.py,比较 _handle_streaming_completion 和 _ahandle_streaming_completion 在缺少解析结果时的处理。然后检查 test_openai_streaming_with_response_model,为最终 completion 的 parsed = None 的流添加覆盖。同步路径返回累积的文本并发出 LLMCallCompletedEvent,与异步行为一致,即为完成。
由索引模型根据 Issue 内容生成。
描述
Description
In the native OpenAI provider, sync streaming with response_model returns an empty string and emits no completion event when the final parse is missing. _handle_streaming_completion only logs "Failed to get parsed result from stream" and returns "", which leaves llm_call_started unpaired. The async twin (_ahandle_streaming_completion) emits the completed event and returns the accumulated text.
Steps to Reproduce
- Stream with
response_modelset and a stream whose final completion hasparsed = None(for example a refusal or an empty parse), as intest_openai_streaming_with_response_model. - The call returns
"", and noLLMCallCompletedEventis emitted.
Expected behavior
Like the async path: the completed event fires with the accumulated deltas and the text is returned.
Screenshots/Code snippets
Same event-pairing family as #8496 and #8498, but those cover other paths.
Evidence
Code reading of lib/crewai/src/crewai/llms/providers/openai/completion.py at 97f2424 (sync handler vs the async one). I can send a fix with a test copied from the existing streaming test.
Operating System
Linux (Debian-based)
Python Version
3.12
crewAI Version
1.15.45 (origin/main at 97f2424)
crewAI Tools Version
Not relevant
Virtual Environment
uv
- 主要语言
- Python
- 星标
- 61.2k
- 派生
- 9.2k
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 180
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
crewAIInc/crewAI 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[FEATURE] Add Straitly as a native OpenAI-compatible LLM provider可能已有人在做 @HashimSyedUBC 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[BUG] Native Azure provider ignores the seed setting可能已有人在做 @basil-k-aji-dev 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
crewAIInc/crewAI#9787 · 1 条评论 ·
维护者通常 1 天内回复
-
[BUG] LiteLLM path reports 0 cached and reasoning tokens in the usage summary可能已有人在做 @basil-k-aji-dev 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[BUG] Native OpenAI async streaming does not send response_model as response_format可能已有人在做 @basil-k-aji-dev 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
fedora-infra/anitya#2272 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
unitaryfoundation/mitiq#3205 ·
维护者通常 6 天内回复
-
[Bug]: Index worker test drops empty Git config values on Windows可能已有人在做 @xiaoyesoso 今天认领。 未关闭triage/confirmed
难度 2/5 1-3 小时 新手友好度 82/100
agentscope-ai/agentscope#4377 · 2 条评论 ·
维护者通常 2 天内回复
-
area/config comp/agent P2 type/perf
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#161039 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
astral-sh/ty-pre-commit#46 ·