Skip to content

fix(agent): add Xiaomi MiMo to reasoning_content echo-back providers (#25358)#25484

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4
May 14, 2026
Merged

fix(agent): add Xiaomi MiMo to reasoning_content echo-back providers (#25358)#25484
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Xiaomi MiMo emits reasoning via OpenAI's reasoning_content field and requires it on every assistant tool-call message when replaying history. Without echo-back, subsequent API calls fail with HTTP 400 — same shape as DeepSeek and Kimi/Moonshot thinking modes (refs #15250, #17400).

Adds _needs_mimo_tool_reasoning() detection (provider == 'xiaomi', 'mimo' in model, or xiaomimimo.com base url) and wires it into the _needs_thinking_reasoning_pad() check.

Salvage of #25358 by @ephron-ren. Manually re-applied — original branch was severely stale against current main (130k+ deletions would have inverse-reverted unrelated work).

Xiaomi MiMo emits reasoning via OpenAI's reasoning_content field and
requires reasoning_content on every assistant tool-call message when
replaying history. Without echo-back, subsequent API calls fail with
HTTP 400 — same shape as DeepSeek and Kimi/Moonshot thinking modes.

Adds _needs_mimo_tool_reasoning() detection (provider == 'xiaomi',
'mimo' in model, or xiaomimimo.com base url) and wires it into the
_needs_thinking_reasoning_pad() check.

Salvage of #25358 by @ephron-ren (manually re-applied — original branch
was severely stale against current main).
@teknium1 teknium1 merged commit efa97af into main May 14, 2026
@teknium1 teknium1 deleted the hermes/hermes-65abd7c4 branch May 14, 2026 06:07
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-65abd7c4 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8319 on HEAD, 0 on base (🆕 +8319)

🆕 New issues (4380):

Rule Count
unresolved-import 1365
invalid-argument-type 1028
unresolved-attribute 934
invalid-assignment 463
unsupported-operator 135
invalid-parameter-default 119
not-subscriptable 88
invalid-method-override 86
invalid-return-type 38
no-matching-overload 32
call-non-callable 28
unresolved-reference 20
unused-type-ignore-comment 14
invalid-type-form 14
not-iterable 6
+6 more rules
First entries
tests/cli/test_cli_shift_enter_newline.py:12: [unresolved-import] unresolved-import: Cannot resolve imported module `prompt_toolkit.input.vt100_parser`
skills/creative/comfyui/tests/test_check_deps.py:5: [unresolved-import] unresolved-import: Cannot resolve imported module `check_deps`
tests/tools/test_vercel_sandbox_environment.py:205: [unresolved-attribute] unresolved-attribute: Unresolved attribute `WriteFile` on type `ModuleType`
gateway/platforms/matrix.py:578: [unresolved-import] unresolved-import: Cannot resolve imported module `mautrix.client.state_store`
environments/tool_call_parsers/llama_parser.py:16: [unresolved-import] unresolved-import: Cannot resolve imported module `openai.types.chat.chat_completion_message_tool_call`
agent/codex_responses_adapter.py:624: [invalid-argument-type] invalid-argument-type: Argument to bound method `dict.get` is incorrect: Expected `Never`, found `Literal["detail"]`
tests/honcho_plugin/test_session.py:1621: [invalid-argument-type] invalid-argument-type: Argument is incorrect: Expected `dict[str, str]`, found `str | bool`
tests/acp/test_tools.py:3: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/agent/test_auxiliary_config_bridge.py:280: [not-subscriptable] not-subscriptable: Cannot subscript object of type `int` with no `__getitem__` method
skills/creative/comfyui/tests/test_run_workflow.py:10: [unresolved-import] unresolved-import: Cannot resolve imported module `extract_schema`
hermes_cli/web_server.py:65: [unresolved-import] unresolved-import: Cannot resolve imported module `fastapi`
tests/tools/test_rl_training_tool.py:23: [invalid-argument-type] invalid-argument-type: Argument is incorrect: Expected `Popen[Unknown] | None`, found `str | dict[Unknown, Unknown]`
gateway/platforms/matrix.py:834: [unresolved-import] unresolved-import: Cannot resolve imported module `mautrix.client.dispatcher`
gateway/platforms/msgraph_webhook.py:174: [unresolved-attribute] unresolved-attribute: Attribute `json_response` is not defined on `None` in union `Unknown | None`
tests/skills/test_google_workspace_api.py:220: [unresolved-attribute] unresolved-attribute: Unresolved attribute `Credentials` on type `ModuleType`
tests/gateway/test_stream_consumer.py:7: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/integration/test_modal_terminal.py:49: [invalid-argument-type] invalid-argument-type: Argument to function `module_from_spec` is incorrect: Expected `ModuleSpec`, found `ModuleSpec | None`
optional-skills/productivity/memento-flashcards/scripts/youtube_quiz.py:30: [unresolved-import] unresolved-import: Cannot resolve imported module `youtube_transcript_api`
plugins/observability/langfuse/__init__.py:490: [unresolved-attribute] unresolved-attribute: Attribute `start_as_current_observation` is not defined on `None` in union `Unknown | None`
tests/run_agent/test_stream_interrupt_retry.py:32: [invalid-argument-type] invalid-argument-type: Argument to `AIAgent.__init__` is incorrect: Expected `bool`, found `str | bool`
tests/hermes_cli/test_kanban_core_functionality.py:1317: [unresolved-attribute] unresolved-attribute: Attribute `max_runtime_seconds` is not defined on `None` in union `Task | None`
tests/hermes_cli/test_kanban_core_functionality.py:2893: [unresolved-attribute] unresolved-attribute: Attribute `skills` is not defined on `None` in union `Task | None`
tests/gateway/test_reload_skills_command.py:20: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/gateway/test_matrix.py:118: [unresolved-attribute] unresolved-attribute: Unresolved attribute `Client` on type `ModuleType`
tests/run_agent/test_concurrent_interrupt.py:83: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_apply_pending_steer_to_tool_results` on type `_Stub`
... and 4355 more

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/xiaomi Xiaomi MiLM labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants