feat: add MiMo Code (mimo CLI) support as a third local agent - #239
Open
luokexiaoguo wants to merge 6 commits into
Open
feat: add MiMo Code (mimo CLI) support as a third local agent#239luokexiaoguo wants to merge 6 commits into
luokexiaoguo wants to merge 6 commits into
Conversation
Add a third AgentAdapter implementation alongside claude and codex that spawns the local `mimo` CLI in headless mode (`mimo run --format json`) with the bridge system prompt on stdin. MiMo's protocol differs from claude/codex in one way: there is no terminal stream event — completion is signalled by the process exiting. The JSONL translator streams text/tool events live and flushes final_text + done when the child exits. It also handles mimo's background checkpoint-writer, which keeps the process alive after the answer is done: a configurable idle timeout (25s default) after the last streaming event finishes the run instead of letting the card sit on "streaming" for a minute.
Extend the agent kind surface so a profile can be created with agentKind=mimo and runs wire through the new adapter: - profile schema: AgentKind includes 'mimo' with a MimoConfig (binaryPath, optional --thinking) and validation - runtime: createRuntimeAgent builds a MimoAdapter; preflight and capability registries recognize 'mimo' - sessions: mimo uses sessionId in the catalog (like claude) and the /resume command gains a mimo branch; run-flow resumes from the catalog entry and forwards image attachments via --file - models: mimo picker options (mimo-auto / provider models)
- --agent accepts mimo on run/migrate/profile create/start; first-run agent detection probes the mimo binary (LARK_CHANNEL_MIMO_BIN) - profile bootstrap resolves and persists mimo.binaryPath - registry and lock metadata accept the mimo agent kind so its processes and per-profile locks are tracked correctly - web onboarding and QR registration forward agentKind=mimo - service status shows the MiMo Code display name
- argv builder unit tests - JSONL translator unit tests (text/reasoning/tool_use/step_finish, session capture, terminal semantics, non-JSON banner lines) - process-level adapter tests with a fake mimo binary (fresh run, resume, permissions mapping, stderr on failure, idle timeout, interrupted stop) - real-binary e2e against an isolated MIMOCODE_HOME; gated on a local mimo provider config + auth and NEWAPI_API_KEY so CI always skips it
Mention MiMo Code as a supported local agent, add the mimo profile examples, the --agent flag values, and the permission-mode mapping (mimo only exposes --dangerously-skip-permissions in v0.1.x, and the profile's model must be configured since the free tier is retired).
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.
Adds MiMo Code as a supported local agent alongside Claude Code and Codex, bridged through the standard
AgentAdapterinterface.What's included
MimoAdapter(src/agent/mimo/): spawnsmimo run --format jsonwith the bridge system prompt on stdin; a JSONL translator maps mimo events (text/reasoning/tool_use/step_finish) to bridgeAgentEvents.--sessionflag; the session catalog stores the mimosessionId(same shape as claude), and/resumegains a mimo branch.--dangerously-skip-permissions; stricter modes leave the flag off (mimo v0.1.x exposes no other permission switch).--agent mimoon run/migrate/profile/start, agent detection, profile bootstrap (mimo.binaryPath), registry/lock metadata, web onboarding, service display name, model picker, README (EN/ZH).Testing
MIMOCODE_HOMErun verifying the full event stream + session continuity; gated on a local mimo provider config + auth andNEWAPI_API_KEYso CI always skips it.tsc --noEmitclean.Notes for reviewers
final_text+doneon exit (or on idle timeout).mimo) with its own provider/auth model; it is only detected/used when a mimo profile is created with--agent mimo.