Skip to content

Tool Parser for Muse Spark - #4441

Merged
dtrawins merged 49 commits into
mainfrom
muse_onyx
Aug 11, 2026
Merged

Tool Parser for Muse Spark #4441
dtrawins merged 49 commits into
mainfrom
muse_onyx

Conversation

@przepeck

Copy link
Copy Markdown
Collaborator

🛠 Summary

CVS-189675
New tool parser for Meta/MuseSpark

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

atobiszei and others added 30 commits July 27, 2026 16:55
Resolved 5 conflicts:
- versions.mk: kept onyx patch-required OV_SOURCE/OV_GENAI pins; advanced
  OV_TOKENIZERS to the newer upstream commit (safe: tokenizers built
  separately with BUILD_TOKENIZERS=OFF).
- src/llm/BUILD, output_parser.cpp, parser_config_validation.cpp,
  chat_template_end_to_end_jinja_test.cpp: additive unions keeping both the
  onyx parsers/tests and the incoming lfm2.5 / minicpm5 parsers/tests.

Unified onyx_tool_parser onto the shared helpers introduced by the incoming
branch: dropped its private parseToolSchema / createToolsParametersTypesMap
(now in base_output_parser) and trimNewline / jsonTypeOf / enforceStringValue
(now in io_processing/utils), which otherwise collided as static-follows-extern
redeclarations. Builds clean: bazel build //src:ovms //src:ovms_test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[Integration branch] changed install deps script to use private repos
[Integration branch] Merging parser into Integration branch
@przepeck
przepeck requested review from dtrawins and mzegla and a balanced review from Copilot August 10, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Onyx/MuseSpark tool-call and reasoning parsing with ATEM framing, template detection, streaming support, and tests.

Changes:

  • Adds Onyx tool and reasoning parsers.
  • Adds Onyx chat templates and automatic detection.
  • Adds parser, template, streaming, and round-trip tests.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/llm/io_processing/onyx/onyx_tool_parser.hpp Declares Onyx tool parsing.
src/llm/io_processing/onyx/onyx_tool_parser.cpp Implements ATEM parsing and streaming.
src/llm/io_processing/onyx/onyx_reasoning_parser.hpp Declares reasoning parsing.
src/llm/io_processing/onyx/onyx_reasoning_parser.cpp Implements reasoning extraction.
src/llm/io_processing/output_parser.hpp Adds special-token decoding state.
src/llm/io_processing/output_parser.cpp Integrates Onyx parsers.
src/llm/io_processing/parser_config_validation.cpp Registers Onyx parser names.
src/llm/io_processing/chat_template/analyzer.cpp Detects Onyx templates.
src/llm/io_processing/chat_template/probe.cpp Recognizes ATEM parameters.
src/llm/BUILD Adds Onyx parser targets.
src/BUILD Adds round-trip test dependencies.
extras/chat_template_examples/chat_template_onyx.jinja Adds example Onyx template.
src/test/llm/chat_templates/chat_template_onyx.jinja Adds Onyx test template.
src/test/llm/output_parsers/onyx_output_parser_test.cpp Tests parser behavior and streaming.
src/test/llm/chat_template_and_parser_onyx_roundtrip_test.cpp Tests template/parser round trips.
src/test/llm/chat_template_end_to_end_minja_test.cpp Adds Minja template tests.
src/test/llm/chat_template_end_to_end_jinja_test.cpp Adds Jinja template tests.
src/test/llm/chat_template_analyzer_test.cpp Tests Onyx detection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/llm/io_processing/output_parser.cpp
Comment thread src/llm/io_processing/onyx/onyx_tool_parser.cpp
if (paramIt != this->toolsParametersTypeMap.end()) {
auto paramJt = paramIt->second.find(currentParameterName);
if (paramJt != paramIt->second.end() && (paramJt->second == ParameterType::BOOLEAN)) {
std::transform(parameterValueAsString.begin(), parameterValueAsString.end(), parameterValueAsString.begin(), ::tolower);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@mzegla what do you think?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good, especially if we already have a function used in another parser

Comment thread src/llm/io_processing/onyx/onyx_reasoning_parser.cpp
Comment thread src/llm/io_processing/onyx/onyx_tool_parser.cpp
Comment thread src/llm/io_processing/onyx/onyx_tool_parser.cpp
Comment thread src/llm/io_processing/chat_template/analyzer.cpp
Comment thread extras/chat_template_examples/chat_template_onyx.jinja
Comment thread src/test/llm/chat_templates/chat_template_onyx.jinja
Comment thread src/llm/io_processing/chat_template/analyzer.cpp Outdated

@mzegla mzegla left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since we have confirmations about this implementation working in demos and getting good accuracy results I approve this - but note the comments. We should plan addressing any doubtful parts as soon as possible.

Comment on lines +103 to +108
// TODO @atobiszei we need to stream between recipient=self & <eom>
// TODO: streaming support is a first draft. It only forwards the chunk as
// reasoning_content once we've seen the "to=self" start tag; stripping the
// generic final-answer envelope (Case 3 above) in streaming mode is not
// implemented yet and needs its own design (the envelope prefix/suffix can
// straddle multiple chunks).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are those TODOs resolved? If so, we should remove it, otherwise, let's plan addressing them.

Comment thread src/llm/io_processing/onyx/onyx_reasoning_parser.cpp
if (paramIt != this->toolsParametersTypeMap.end()) {
auto paramJt = paramIt->second.find(currentParameterName);
if (paramJt != paramIt->second.end() && (paramJt->second == ParameterType::BOOLEAN)) {
std::transform(parameterValueAsString.begin(), parameterValueAsString.end(), parameterValueAsString.begin(), ::tolower);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good, especially if we already have a function used in another parser

Comment thread src/llm/io_processing/onyx/onyx_tool_parser.cpp
@dtrawins
dtrawins merged commit 9be7564 into main Aug 11, 2026
1 check passed
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.

6 participants