Feature: 支持trace上报思考文本放<trace_think>块里#224
Conversation
weimch
commented
Jul 23, 2026
- 方便区分思考文本和正常文本,同时保持兼容性
- 方便区分思考文本和正常文本,同时保持兼容性
AI Code Review发现的问题🚨 Critical
|
| result = [] | ||
| for part in parts: | ||
| text = part.text or "" | ||
| if getattr(part, "thought", False): |
There was a problem hiding this comment.
MagicMock 未设置 thought 导致思考段判定恒真
_join_parts_with_thought_tag 用 getattr(part, "thought", False) 判断思考段,但测试 _make_part 用无 spec 的 MagicMock,任意未定义属性返回真值子 mock,导致所有文本段都被包成 <trace_think>...</trace_think>,现有断言大面积失败、CI 阻塞。修复建议:在 _make_part 显式 part.thought = False 或改用 spec=Part 的 mock,并补充 thought=True 用例。
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA minchangwei seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |