Skip to content

feat(mimocode): close the measured MiMo Code harness gaps - #38661

Open
jief123 wants to merge 1 commit into
kirodotdev:mainfrom
jief123:feat/mimo-capability-gaps
Open

jief123 wants to merge 1 commit into
kirodotdev:mainfrom
jief123:feat/mimo-capability-gaps

Conversation

@jief123

@jief123 jief123 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A MiMo Code chat gets the Crew features its harness can carry: default-agent steering, session-bound Crew servers, spec hooks that observe, unstartable-server reporting, MCP changes on a running session, Bots, and read-only tools in Side Chat and thread replies.

MiMo Code shipped as a harness in #24732 with only the capabilities that PR measured. On main today a MiMo Code chat:

  • never receives the default agent's .kiro/steering rules (MiMo loads AGENTS.md itself but not that tree, and Crew does not load it either);
  • drops every identity-bound Crew server (kirocrew-work, -guide, -mate, -dashboard for non-members), because the mirror admitted no gateway broker stub;
  • runs none of a spec's postToolUse, userPromptSubmit, agentSpawn or stop hooks;
  • shows an MCP server whose command does not exist as silently missing rather than failed;
  • keeps the old MCP set after the user changes it on the MCP page, until the chat is closed;
  • refuses a Bot pinned to mimocode, and a Bot that inherits it falls back to KAS;
  • answers Side Chat and thread replies with no tools at all (REJECT_ALL).

Why it matters

Users who pick MiMo Code under Settings > Agent Harness lose project rules, Crew's own tools and Bots without any message saying so, and a Side Chat cannot even read a file the main chat just discussed. Each gap is one the harness can carry; leaving them makes MiMo Code a second-class harness for reasons on Crew's side.

Not a goal

  • ACP_BACKENDS_CWD_BOUND_SESSIONS: measured not needed (a second mimo acp process loading a session in another folder honours approvals, pwd and MCP).
  • ACP_BACKENDS_REPORT_USAGE: MiMo 0.1.15 reports zero tokens and no added cost for a turn whose tool call was rejected, though the model was called and billed (measured on its own xiaomi provider). A candidate upstream issue, not a Crew change.
  • An effort picker for MiMo Code: its levels are model-id suffixes (xiaomi/mimo-v2.6-pro/high), which needs a channel of its own.
  • Gating preToolUse hooks on MiMo Code: memory, history and task never ask, so a gating hook would be skipped on exactly those calls.
  • Web tools in a MiMo Code Side Chat: webfetch and websearch stay refused by READ_ONLY.
  • Any change to another harness's behaviour.

What changed (motivation → approach → change)

A MiMo Code chat gets the project's .kiro/steering rules, Crew's own tools, spec hooks, MCP changes while it runs, Bots, and read-only tools in Side Chat, because each gap was on Crew's side and the harness can carry it.

Every capability is a positive ACP_BACKENDS_* membership for ACP_BACKEND_MIMOCODE (harness-parity H6), each backed by a live 0.1.15 capture under test/fixtures/acp_frames/mimocode/. Nothing imports the opencode or codex harness modules; where their logic applies, MiMo carries its own copy.

  1. Steering. Crew loads the .kiro/steering rules into a MiMo Code chat (CREW_LOADS_SPEC_STEERING) and leaves AGENTS.md to MiMo, which reads it itself (NATIVE_PROJECT_AGENTS_MD). Live, MiMo knew only the AGENTS.md codeword. The mirror's RESOURCES ruling becomes RESOURCES_NO_READER.
  2. Crew stubs. place_mimocode_array admits a broker stub for an identity-bound Crew server only in the shape bound to this session's token (codex's rule, copied); spec filters still apply.
  3. Observer hooks. Joins CREW_FIRES_SPEC_OBSERVER_HOOKS; the HOOKS ruling becomes NO_CHANNEL, as on claude and codex.
  4. Unstartable MCP. Joins PRUNE_UNSTARTABLE_MCP: MiMo drops a stdio element whose command does not exist with nothing on the wire.
  5. Relaunch-reload. Joins MCP_RELAUNCH_RELOAD: a second process loading the session with a server added or withdrawn mounts the new set and keeps the history; the launch clears the relaunch mark right before it derives the array, as strands does.
  6. Bots. Joins MEMBER_CAPABILITIES, MATE_WORKER_KIT, MATE_WORKER_PROMPT_IN_CONTEXT and TEMPLATE_ADDITIONS_AT_SPAWN; the mirror passes session_key to session_mcp_projection so a worker reads its own spec.
  7. Side Chat and thread replies. Joins SIDE_READONLY.
    • The side seed keeps "*": "ask" and denies every writer, the shell and every unasked tool but invalid and mcp_tool_search; a deny removes the tool from the list the model is offered.
    • The launch read-back refuses a side session when one of those denies is not in force in every context, when MiMo mounts an MCP server from its own config, or when it loads any plugin: a project .mimocode/plugin/ file registering read ran in place of the built-in, unasked (measured).
    • The array is empty, and the governed-MCP refusal reads the same seam, so an mcp control does not refuse a side session for servers it never mounts. The tripwire allows only the two inert unasked tools.
    • Only read, grep and glob, named by the call's first tool_call title, with an ABSOLUTE target from the trusted params cache, are named fs_read/grep/glob; a search root must hold no sensitive location and a glob pattern must stay under it, as kiro-cli's search proof requires. grep and glob ask before the running update that carries path, so _defer_mimocode_side_read_permission holds such a request for one frame, as the shell deferral does; the request's own rawInput never proves a read.
    • dashboard/handlers/side.py and dashboard/chat_threads.py request side_read_only and send a boundary with reads and searches, no shell, and fetching refused (SIDE_BOUNDARY_PROMPT_NO_WEB, THREAD_BOUNDARY_PROMPT_NO_WEB).
    • Captured twice, behind a LiteLLM proxy and on MiMo's own xiaomi provider (side-read-only-live.jsonl, side-read-only-xiaomi-live.jsonl): the three reads asked, no write or shell tool was offered, and no file was created.
Area Files
Capability sets agent_sdk/backends_routing.py, agent_sdk/backends_mcp.py, agent_sdk/backends_members.py, agent_sdk/backends_sessions.py (why mimocode is not cwd-bound), agent_sdk/capabilities.py, agent_sdk/backend_mcp_ability.py, agent_sdk/spec_hooks.py, agent_sdk/drivers/acp.py
MiMo Code launch and mirror acp/harness/mimocode.py, providers/mirrors/mimocode.py, providers/mirrors/base.py
Side Chat gate acp/_dispatch_parts/permission_requests.py, acp/_dispatch.py, acp/client_turn.py, acp/client_class.py, acp/client_permissions.py, acp/client_mcp_array.py, acp/harness_tool_names.py
Side Chat and threads dashboard/handlers/side.py, dashboard/chat_threads.py, dashboard/side_prompts.py, dashboard/side_context.py
Steering, hooks, Bots folder_steering.py, context_assembly/inclusion.py, context_assembly/agent_spec.py, crewmate_harness.py, dashboard/chat_turn/turn_spec_hooks.py
Docs docs/agent-spec-fields.md, docs/steering-and-hooks.md, and the owning specs under docs/system-specs/ and docs/architecture/, the fixtures README

Backwards compatibility

Compatible: only the mimocode backend gains memberships; every other harness's sets and code paths are unchanged, and a MiMo Code session that worked before keeps working (the new side-session refusals apply only to a Side Chat or thread reply, which ran no tools before).

Removes nothing: no key, record, path or public function is removed or renamed; the one renamed test (test_antigravity_goose_deepseek_copilot_and_mimocode_are_the_pruned_backends) only adds a member to its assertion.

Tests

New files, each replaying the live captures through the real parsers and gates:

  • test/test_mimocode_crew_stub.py: a broker stub bound to this session's token is placed; a forged, foreign-token or reshaped stub is not; spec allowlist, disabled and per-tool deny still drop one.
  • test/test_mimocode_observer_spec_hooks.py: the four observer hooks fire on bash, notebook_edit, actor and MCP calls replayed from four captures; preToolUse gets the notice.
  • test/test_acp_mimocode_mcp_relaunch.py: a marked change relaunches before the turn and loads the same id with the new array; the mark is cleared before the array is derived.
  • test/test_mimocode_member_captures.py: the saved-spec projection and the worker kit mount exactly the server each capture called.
  • test/test_side_readonly_mimocode.py: both side captures, driven through a real AcpClient turn loop, prove read/grep/glob and run under READ_ONLY; writers, shell, unasked, MCP, web, relative and pathless calls, a search over the home folder and a glob pattern leaving its root are refused; an inline rawInput/input/params never proves a read; the seed, the read-back (lost deny, native MCP mount, plugin), the empty array and the narrowed tripwire.

Updated: test_acp_mcp_startable.py, test_acp_mimocode_backend.py, test_acp_mimocode_launch.py (an mcp control lets a side session start with its empty array), test_acp_strands_mcp_relaunch.py, test_backend_cards.py (MiMo Code core count 4 → 5), test_chat_steering_plan.py, test_chat_threads.py, test_client_bindings.py, test_crew_fired_spec_hooks.py, test_folder_steering_provider_dedup.py, test_harness_parity.py, test_mate_worker_harnesses.py, test_side_turn_confinement.py, test_spec_hook_kas_tool_names.py.

Mutation pins: each membership and each guard line on the B2/B3, A1/A2/A6/A7 and Side Chat paths (18 for Side Chat alone) was removed or loosened in turn, and at least one test failed every time.

Local runs: black, isort, flake8, mypy --platform linux src/kiro_crew (4833 files), check_harness_parity.py, comment-history, brand, docs-lint.sh, semgrep against the merge-base (no finding), the flake ratchet. The full related set (backend 7 batches, frontend 3) on this change failed only where clean origin/main fails the same way under the same environment (test_host_git_repo_exec_neutralization, test_kas_cli_floor pidfd, test_kas_session_start_queue x2, UsageTab.spendChartHarness). On this head: the 111 MiMo Code, Side Chat, harness-parity and bindings files (6669 passed) and the facade, cards and MiMo Code files again (1447 passed).

Manual verification

  • Live probes against mimo acp 0.1.15 for every capture above, behind a LiteLLM proxy (Bedrock Claude Haiku 4.5) and, for Side Chat and the usage check, on MiMo's own xiaomi provider (xiaomi/mimo-v2.6-pro, billed).
  • Still required: an end-to-end pass through the dashboard on a pod. This host's kernel.apparmor_restrict_unprivileged_userns=1 keeps the pod from booting, so the steps (Side Chat read/search/refuse, thread reply, plugin and MCP refusals, observer hooks, unstartable MCP, MCP change on a running chat, a Bot on MiMo Code) are written down but not yet run.

Related Issues

Closes #38455

Follows #24732. #38452 put opencode and pi in the same two steering sets (CREW_LOADS_SPEC_STEERING, NATIVE_PROJECT_AGENTS_MD); mimocode joins beside them. #38927 put pi in MATE_WORKER_KIT and MATE_WORKER_PROMPT_IN_CONTEXT; mimocode joins beside it there too. The H6 row of harness-parity.md keeps #39846's wording, with the mimocode side-chat sentences added to it.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

I agree that this contribution is licensed under the project's Apache-2.0 license.

@jief123
jief123 requested review from a team and KiroCrewCaptain as code owners November 17, 2026 17:12
@jief123
jief123 requested a review from dodgeblaster November 17, 2026 17:12
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Nov 17, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from ef232f9 to eb48fa0 Compare November 17, 2026 19:01
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from eb48fa0 to bcf5b7b Compare November 20, 2026 05:38
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 20, 2026
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from bcf5b7b to c5fba02 Compare November 20, 2026 08:57
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 20, 2026
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from c5fba02 to d17bf26 Compare November 20, 2026 11:56
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 20, 2026
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from d17bf26 to 9fd629c Compare November 20, 2026 14:29
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 20, 2026
A MiMo Code chat gets the Crew features its harness can carry, each a
positive ACP_BACKENDS_* membership for mimocode backed by a live 0.1.15
capture, with no import from the opencode or codex harness modules:

- steering: CREW_LOADS_SPEC_STEERING and NATIVE_PROJECT_AGENTS_MD; MiMo
  reads AGENTS.md itself but no .kiro/steering tree
- Crew servers: the mirror admits a gateway broker stub only in the
  shape bound to this session's stub token
- spec hooks: CREW_FIRES_SPEC_OBSERVER_HOOKS; preToolUse stays out
  because memory, history and task never ask
- unstartable MCP: PRUNE_UNSTARTABLE_MCP
- MCP changes: MCP_RELAUNCH_RELOAD; the launch clears the relaunch
  mark before it derives the array
- Bots: MEMBER_CAPABILITIES, MATE_WORKER_KIT,
  MATE_WORKER_PROMPT_IN_CONTEXT, TEMPLATE_ADDITIONS_AT_SPAWN
- Side Chat and thread replies: SIDE_READONLY. The side seed denies
  every writer, the shell and every unasked tool; the read-back refuses
  a session where a deny is not in force, MiMo mounts its own MCP
  server, or a plugin is loaded; only read, grep and glob on an
  absolute target from the trusted cache are proven reads, a request
  that arrives before its running update is held one frame, and web
  tools stay refused

CWD_BOUND_SESSIONS records why mimocode is not a member; REPORT_USAGE
and an effort picker stay out.

Part of kirodotdev#38455
@jief123
jief123 force-pushed the feat/mimo-capability-gaps branch from 9fd629c to d65b1c9 Compare November 20, 2026 19:39
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiMo Code: carry steering, Crew servers, spec hooks, MCP changes, Bots and Side Chat tools

1 participant