Skip to content

common: load parser in common_chat_parser_params constructor#21659

Open
sacredvoid wants to merge 1 commit intoggml-org:masterfrom
sacredvoid:fix-chat-parser-params-constructor
Open

common: load parser in common_chat_parser_params constructor#21659
sacredvoid wants to merge 1 commit intoggml-org:masterfrom
sacredvoid:fix-chat-parser-params-constructor

Conversation

@sacredvoid
Copy link
Copy Markdown
Contributor

@sacredvoid sacredvoid commented Apr 9, 2026

Overview

common_chat_parser_params copies format and generation_prompt from common_chat_params but never calls parser.load(). Without that call, common_chat_parse() falls back to a content-only parser, so tool calls end up in msg.content instead of msg.tool_calls. The server works around this by loading the parser separately, but anyone using the library directly hits this bug.

Adds the missing parser.load() call in the constructor (3 lines) and a test that verifies the constructor path parses tool calls end-to-end.

Additional information

Fixes #21650

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - used for identifying the root cause and drafting the fix + test.

@sacredvoid sacredvoid requested review from a team and pwilkin as code owners April 9, 2026 05:03
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.

Misc. bug: common_chat_parser_params needs to load from string.

1 participant