Models using the harmony parser may output analysis/thinking segments
before JSON arguments in tool calls. For example:
<|channel|>analysis<|message|>I need to list files.{"path": "/tmp"}
Previously this would fail JSON parsing. Now the parser:
- Extracts and strips harmony analysis segments before JSON
- Preserves the thinking content separately
- Uses brace-matching to extract complete JSON objects
This brings the harmony parser in line with Qwen3VL and Cogito parsers
which already handle mixed thinking/tool call content via event-based
parsing.
|
||
|---|---|---|
| .. | ||
| harmonyparser.go | ||
| harmonyparser_test.go | ||