chore(adpator):Adapt MindIE engine model and improve testing and fixes#2523
Merged
WillemJiang merged 19 commits intobytedance:mainfrom Apr 28, 2026
Merged
chore(adpator):Adapt MindIE engine model and improve testing and fixes#2523WillemJiang merged 19 commits intobytedance:mainfrom
WillemJiang merged 19 commits intobytedance:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MindIE chat model adapter’s XML tool-call serialization to avoid JSON-quoting string arguments, and extends the test suite to cover the updated serialization plus additional parsing/newline-handling scenarios.
Changes:
- Update XML tool-call serialization to emit raw string argument values (instead of
json.dumps-quoted strings). - Update/extend tests to expect unquoted string args, add coverage for nested tool-call blocks, escaped newlines inside code fences, and timeout kwarg normalization.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
backend/packages/harness/deerflow/models/mindie_provider.py |
Adjusts tool-call XML serialization to keep string args unquoted. |
backend/tests/test_mindie_provider.py |
Updates assertions for unquoted string args; adds tests for nested tool-call parsing, newline decoding behavior, and timeout normalization. |
Comment on lines
39
to
40
| args_xml = " ".join(f"<parameter={k}>{v if isinstance(v, str) else json.dumps(v, ensure_ascii=False)}</parameter>" for k, v in tool.get("args", {}).items()) | ||
| xml_parts.append(f"<tool_call> <function={tool['name']}> {args_xml} </function> </tool_call>") |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Collaborator
|
@pyp0327, please take a look at the broken test. |
…-flow into feat/mindie-adapter
… parse, with regression tests added.
WillemJiang
approved these changes
Apr 28, 2026
TsingFengIceberg
pushed a commit
to TsingFengIceberg/deer-flow
that referenced
this pull request
Apr 28, 2026
bytedance#2523) * feat(models): 适配 MindIE引擎的模型 * test: add unit tests for MindIEChatModel adapter and fix PR review comments * chore: update uv.lock with pytest-asyncio * build: add pytest-asyncio to test dependencies * fix: address PR review comments (lazy import, cache clients, safe newline escape, strict xml regex) * fix(mindie): preserve string args without JSON quotes in XML tool call serialization * fix(mindie): preserve string args without JSON quotes in XML tool call serialization * test_mindie_provider:format * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix(mindie): prevent nested tool_call params from leaking into outer args * fixed by escaping XML entities in _fix_messages and unescaping during parse, with regression tests added. --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(mindie): preserve string args without JSON quotes in XML tool call serialization
test(mindie): update xml serialization assertion to expect unquoted string args