Fix stream compatibility and vision model exposure#364
Conversation
|
@adnxx1wsx is attempting to deploy a commit to the cjack's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 241334c658
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| finalText = replaceCitationMarkersWithLinks(finalText, result.CitationLinks) | ||
| } | ||
| detected := detectAssistantToolCalls(finalText, finalThinking, finalToolDetectionThinking, toolNames) | ||
| detected := detectAssistantToolCalls(result.Text, result.Thinking, result.ToolDetectionThinking, toolNames) |
There was a problem hiding this comment.
Preserve thinking fallback when visible text sanitizes empty
Passing raw upstream text into detectAssistantToolCalls changes fallback semantics: DetectAssistantToolCalls returns immediately whenever strings.TrimSpace(text) != "", so any leaked DSML/XML wrapper present in result.Text (even if cleanVisibleOutput later strips it to an empty visible reply) prevents parsing valid tool calls from thinking. In that case non-stream chat can now emit upstream_empty_output/tool-choice errors instead of returning the tool call. This regression is introduced here because this call used to pass sanitized finalText, which allowed thinking fallback when the visible text was effectively empty.
Useful? React with 👍 / 👎.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information