Skip to content

chore(adpator):Adapt MindIE engine model and improve testing and fixes#2523

Merged
WillemJiang merged 19 commits intobytedance:mainfrom
pyp0327:feat/mindie-adapter
Apr 28, 2026
Merged

chore(adpator):Adapt MindIE engine model and improve testing and fixes#2523
WillemJiang merged 19 commits intobytedance:mainfrom
pyp0327:feat/mindie-adapter

Conversation

@pyp0327
Copy link
Copy Markdown
Contributor

@pyp0327 pyp0327 commented Apr 25, 2026

fix(mindie): preserve string args without JSON quotes in XML tool call serialization
test(mindie): update xml serialization assertion to expect unquoted string args

Copy link
Copy Markdown
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 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>")
Comment thread backend/tests/test_mindie_provider.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@WillemJiang WillemJiang changed the title Adapt MindIE engine model and improve testing and fixes chore(adpator):Adapt MindIE engine model and improve testing and fixes Apr 26, 2026
@WillemJiang
Copy link
Copy Markdown
Collaborator

@pyp0327, please take a look at the broken test.

@WillemJiang WillemJiang merged commit 395c143 into bytedance:main Apr 28, 2026
5 checks passed
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>
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.

3 participants