Skip to content

Conversation

@dkalinowski
Copy link
Collaborator

🛠 Summary

Fix for scenarios where model generated json<|message|>{ in single iteration

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a streaming bug where the model generates json<|message|>{ in a single iteration, causing the constrain token to be incorrectly glued to the tool call message. The fix modifies the READING_CONSTRAIN state to detect and handle the <|message|> token within the same chunk.

Changes:

  • Enhanced constrain reading logic to search for and handle embedded <|message|> tokens
  • Added comprehensive test case covering the scenario where constrain is glued with tool call message

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/llm/io_processing/gptoss/tool_parser.cpp Added logic to detect `<
src/test/llm/output_parsers/gptoss_output_parser_test.cpp Added test case ConstrainGluedWithToolCall to verify correct handling of glued constrain and message tokens

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants