MiMo-Code
MiMo-Code copied to clipboard
v0.1.0: All tools fail with 'undefined is not an object (evaluating J.replace)'
Environment:
- OS: Windows 11 Pro (10.0.26100)
- MiMo Code version: v0.1.0 (mimo.exe, Bun-compiled PE32+ binary)
- Provider: xiaomi (https://token-plan-cn.xiaomimimo.com/v1)
- Model: mimo-v2.5-pro
- Shell: PowerShell
Bug description: All tool calls (bash, read, write, glob, grep, etc.) fail with the same JavaScript error:
undefined is not an object (evaluating 'J.replace')
Where J is a minified variable name in the compiled binary. This happens on EVERY tool, regardless of the tool type or arguments.
Steps to reproduce:
- Launch
mimo.exeon Windows - Login with xiaomi provider account
- Send any message that triggers a tool call (e.g., 'list files in current directory')
- All tools return the same error
Error output from TUI:
$ dir
+ Error (1 line)
→ Read .
+ Error (1 line)
The model itself observes: '所有工具都出现相同的JavaScript错误 (undefined is not an object (evaluating J.replace'))'
Analysis:
- The error is NOT in the backend logs (no TypeError logged) — it's in the Bun-compiled JavaScript execution layer
- The
Jvariable is a minified name that should hold a string but isundefined - The error occurs in the common tool execution path, before the specific tool logic runs
- Likely location: tool description template expansion in
packages/opencode/src/tool/bash.ts(lines 626-631,.replaceAll()chain) orpackages/opencode/src/tool/shell-wrap.ts(escapeAttrfunction), where a template variable resolves toundefined - The user's config at
~/.mimocode/config.jsonpreviously had stale ollama settings (runtime/endpoint/model) which have been cleaned, but the error persists — confirming this is a code bug, not a config issue
Additional context:
- MCP servers (playwright, chrome-devtools, danbooru, codegraph) connect successfully
- The auth.json correctly shows xiaomi provider with valid API key
- model.json correctly shows mimo-v2.5-pro as the active model