Skip to content

feat(acp): onboard MiMo Code as an enforced ACP backend - #24732

Merged
buluoray merged 1 commit into
kirodotdev:mainfrom
jief123:feat/mimo-backend
Nov 13, 2026
Merged

buluoray merged 1 commit into
kirodotdev:mainfrom
jief123:feat/mimo-backend

Conversation

@jief123

@jief123 jief123 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A user can pick MiMo Code under Settings → Agent Harness and run Kiro Crew sessions on it with Crew's tool gate enforced.

MiMo Code (npm @mimo-ai/cli, mimo acp) is a fork of OpenCode. Kiro Crew cannot select it today, and pointing OPENCODE_BIN at mimo does not work: the fork reads MIMOCODE_CONFIG_CONTENT, not OPENCODE_CONFIG_CONTENT, so Crew's permission: "ask" seed never arrives and the session runs on the harness's own approval settings. The fork also differs from OpenCode on the wire in ways the gate depends on: its own tool names, native tools that never ask, and a loopback listener that can switch approvals off.

Why it matters

MiMo Code is the harness for Xiaomi's MiMo models and provider. Without a backend of its own, a user who wants it either cannot use Crew or runs it behind a re-pointed id with no enforcement at all, which is worse than not offering it.

Not a goal

  • Concurrent-prompt steer on MiMo Code (the harness answers a second session/prompt with an empty end_turn).
  • Honouring a zero-tool spec on MiMo Code: memory, history and task never ask and have no switch, so the backend is excluded instead.
  • Closing the harness's unauthenticated loopback routes (POST /permission/skip-all, POST /permission/:id/reply): that needs an upstream change; this PR detects their effect.
  • Background actor subagents: they fail closed under Crew, because they inherit only stored grants and Crew stores none; one whose never-asking call spans a turn boundary can stop the session (the tool name is cleared at each turn start).
  • The GPT toolset (exec / wait): pinned off, not supported.
  • Sharing code with the opencode launch or mirror.
  • The auto-approve path writing the generic allow_once to an OpenCode-family harness (shared code; no production caller reaches it on either backend).

What changed (motivation → approach → change)

MiMo Code becomes its own backend, mimocode, enforced like OpenCode (VERIFIED_SEEDED_SETTINGS): Crew seeds permission: "ask", reads it back before the first prompt, and refuses the session when it does not hold. Re-pointing the opencode id was rejected (the seed variable differs, and a shipped id is not re-pointed), and so was subclassing the opencode modules, because the two harnesses already diverge on tools, listener routes and config names; the new modules import nothing from them. Every MiMo Code helper that reads like an opencode one is therefore a deliberate copy, not only in the launch and the mirror but in the two shared modules too: client_turn.py's shell-permission reorder (_defer_mimocode_shell_permission, keyed on the two ask titles that carry no command, which opencode's is not) and harness_tool_names.py's name helpers (mimocode_rewrites_name, _mimocode_mcp_splits, mimocode_spelling, which write a character outside the BMP as __ the way the harness's UTF-16 replace does; _opencode_mcp_splits writes one _). Each is written to MiMo Code 0.1.15's measured frames, so a later change to opencode's code cannot change what MiMo Code enforces, and test/test_acp_mimocode_backend.py pins that neither module imports the other's.

Part Effect
Launch, acp/harness/mimocode.py seed and read-back (mimo debug config), judged by MiMo Code's own rule algebra (permission/evaluate.ts, index.ts disabled()): the last matching rule wins, a tool is hidden by its own id or by its edit/read group, and agent rules follow the top level, so an agent printed as permission: {} inherits; the 0.1 line version gate, MIMOCODE_HOME refused before any child runs, cron / experimental toolsets / codex mode pinned off, the switches the read-back cannot see stripped; a server switched off in Crew that the harness mounts from its own config refuses the session
Mirror, providers/mirrors/mimocode.py the agent spec's per-tool MCP deny written into the seed (a bare "deny" where MiMo Code's schema takes only a string); the array merged by name, the later entry winning, as the harness does; only ids that collide with its edit/read groups (apply_patch, view_image) withhold a server whole; spec hooks withheld
Tool and argument tables, acp/harness_tool_names.py use_subagent is actor; notebook_path and patch_text read as file_path and patchText, applied in permission_requests.py to mimocode events only; an MCP call is handled as the opencode backend already handles it: no (server, tool) pair is read off its fused <server>_<tool> title, the gate judges the title, and _mimocode_mcp_splits (MiMo Code's copy of _opencode_mcp_splits, in its UTF-16 spelling) gives the hooks that match a harness id the title's @server/tool splits
Tripwire, acp/client_permissions.py stops the harness when a call completes unasked (all but the tools the harness never asks for, HARNESS_UNASKED_TOOL_IDS, with actor passing only when its input starts no subagent, mimocode_actor_asks_nothing, and writes inside its memory tree), or completes before Crew answered its ask; always is sent as once
Turn loop, acp/client_turn.py the shell-permission reorder for the two ask titles that carry no command (bash and external_directory: MiMo Code sends rawInput: {} and the command only on the following update, tool/bash.ts); bash_delete carries its command and is not held
Capability sets, agent_sdk/ a decision per set; new ACP_BACKENDS_UNASKED_NATIVE_TOOLS (keeps it out of the zero-tool honor set) and ACP_BACKENDS_MODEL_SELECT_UNCHECKED (the harness accepts any model value, so Crew checks it); acp/client_model_selection.py drops <provider>/ from MiMo Code's <provider>/<model> (<variant>) labels, which the picker cut off before the variant (mimocode_model_rows; kept whole if two rows would read alike, ids unchanged)
Fences agent.env refuses MIMOCODE_* (config/sections_agent_env.py); the token, global config and project config are fenced (agent_sdk/host_auth.py, agent_sdk/native_allow_stores.py, the aws-control builder's standalone list, src/kiro_crew/apps/builtins/aws_control/crew/packaging/pipeline/sensitive.py)
Evidence seven live captures off 0.1.15 in test/fixtures/acp_frames/mimocode, all seven frame classes

MCP governance follows the opencode precedent on purpose. On main the opencode backend names no server or tool for an MCP call (its mirror's DENIED_TOOLS ruling: "the harness sends only a fused <server>_<tool> title"; hook_runtime/gate_tiers.py lists opencode among the harnesses that name no server), so governance's mcp scope is not asked for such a call and a rule written for a real tool name (@ops/repo.delete) does not meet the rewritten title ops_repo_delete; the spec's per-tool denies reach the harness through its own config instead. MiMo Code sends the same title, so this backend takes the same position and the same residual, stated in acp-client.md and in the onboarding residual row. Where that would leave a governance control unapplied, the session is refused instead: when the installed ceiling or any configured profile constrains mcp at all (mcp_scope_governed_now in platform/governance.py, its profile half any_configured_profile_constrains in platform/governance_profiles.py, both fail-closed), a MiMo Code session that would mount any server -- Crew's array or the harness's own config -- is refused after the read-back with a remedy naming the servers; a session with nothing to mount starts, and a host with no mcp control is unchanged. Closing the gap itself would be one change for both backends.

The registrations follow the existing seams: acp_backends.py, acp/types.py, acp/harness/__init__.py, providers/acp.py, providers/mirrors/registry.py, the parity gate's expected agent name and its classification of the two new sets in scripts/check_harness_parity.py, the dashboard's harness name (website/src/api/acpBackend.ts, one agentBackendTab.mimocode key per catalog in website/src/i18n/locales, as Strands has, and MiMo Code on the do-not-translate list in website/src/i18n/glossary.json, which the i18n gate asks for a name every locale keeps as written), and the owning docs under docs/ and src/kiro_crew/docs (host contract, onboarding worked example, acp-client, security, governance, harness parity, model selection, configuration, agent spec fields). Session Activity counts its sessions from usage rows (dashboard/handlers/usage_store.py, usage.py).

Backwards compatibility

Compatible: every behaviour change is scoped to the new mimocode id, and the shared readers it feeds keep their results on every other backend (the shared tool vocabulary is unchanged, and the related suites pass).

Reader: src/kiro_crew/acp/harness/mimocode.py:MimoCodeLaunch.resolve_spawn -- chat -- the new extra_hidden_dirs masks apply only to MiMo Code's own children (version probe, read-back, session); test_acp_mimocode_backend.py::test_the_read_back_and_the_version_probe_run_wrapped_and_off_the_loop
Reader: src/kiro_crew/config/sections_agent_env.py:agent_env_refusal -- chat -- MIMOCODE_* names no variable any backend read before this one, so no working agent.env loses an effect; test_acp_mimocode_backend.py::test_agent_env_drops_a_mimocode_name
Reader: src/kiro_crew/security/paths.py:sensitive_write_path_refusal -- subagent -- refuses only the agent's file-edit tools on files only MiMo Code reads (~/.config/mimocode/*, a project's mimocode.json, .mimocode/); reads and gateway writers are unchanged; test_native_allow_stores.py::test_every_store_is_refused_for_file_edits_and_stays_readable
Reader: src/kiro_crew/security/paths.py:is_sensitive_path -- cron -- the one new read refusal is MiMo Code's OAuth token ~/.local/share/mimocode/auth.json, the same class as OpenCode's; test_acp_mimocode_backend.py::test_the_token_leaf_is_fenced_at_home_and_under_its_override

Tests

File Locks in
test/test_acp_mimocode_backend.py registration, env pins and refusals, tool and argument tables, tripwire unit rules, and the mimocode cases of the shared surfaces (agent.env, credential fences, compaction, knowledge pool, first-run setup)
test/test_acp_mimocode_launch.py the launch end to end at its own seams: read-back and version probe wrapped and off the loop, the deny rules found out of force and the re-projection, and the governance refusal (a ceiling denying @ops/repo.delete refuses a session that would mount a server; a profile-only rule counts; no server, or no mcp control, starts)
test/test_acp_mimocode_config.py read-back and version-gate failure branches, env scrub, refusal-text scrub, per-tool MCP deny incl. the wildcard complexity bound, the mirror
test/test_acp_mimocode_turn.py shell-permission reorder on every branch, tripwire replayed from the live captures through _dispatch_events, always → once; the captured MCP call names no server, as on opencode (both backends run through one test), its title splits back for the hooks (a dotted server name and an astral one), and a rule on the fused title denies it

Shared enumerating tests gain their mimocode row; test_native_allow_stores.py exempts it from the single-variable override check for the same reason as opencode (config under XDG_CONFIG_HOME, token under XDG_DATA_HOME).

Determinism: the three new files of that revision and test/test_native_allow_stores.py (401 tests) passed 20 consecutive -n0 runs; all 18 changed test files (1659 tests) passed 5 runs under -n 4 --dist loadgroup and one run in a shuffled order (seed 24711, -n0); after the MCP handling moved to the opencode precedent, the three new files and test/test_native_allow_stores.py (455 tests) passed 5 more consecutive -n0 runs.

Manual verification

Driven live on mimo acp 0.1.15 with the xiaomi/mimo-v2.6-flash/low model through the worktree's AcpClient:

  • notebook_edit refused before the argument alias, allowed after it (the cell changed).
  • Foreground actor subagent: both asks reach Crew; a background one fails closed.
  • Tripwire: an external POST /permission/:id/reply answer and a skip-all edit each stopped the harness; a write in the memory tree did not.
  • With every stripped switch set in the gateway environment, the child had none of them and the model's own tool list showed no cron, workflow, session or exec.
  • A project mimocode.json giving agent.build only a model (printed back as permission: {}) starts a session; a {"*": "deny"} under a string-only key such as doom_loop makes MiMo Code reject the whole config, which is why the seed writes a bare "deny".
  • By hand in a dashboard pod of this worktree: MiMo Code picked under Settings → Agent Harness on xiaomi/mimo-v2.6-flash/low, a session run with a shell call approved from its card.

Screenshots / video

Committed under temp-screenshots/24732-mimocode-harness/ (fork PR: --attach is unavailable to me; the maintainer drops the directory after merge). Settings → Agent Harness, light theme, 1440×1000, taken from a pod running this head.

The list with the new row (MiMo Code, between goose and OpenCode, status badge from the probe):

Agent Harness list with the MiMo Code row

The row opened, MiMo Code installed: Experimental badge, the "Use MiMo Code" button, the sign-in note, the 4-of-7 capability list and the agent-config notes:

MiMo Code detail, installed

The row opened, MiMo Code not installed: the install command, "Check again", and the disabled Use button:

MiMo Code detail, not installed

The chat failure states, same theme and size, each from a real session in a pod running this branch:

A session refused because the host's security policy carries an mcp rule while the chat mounts MCP servers (the governance refusal, _mimocode_governed_mcp_issue):

MiMo Code chat refused: an MCP rule on the host

The harness stopped mid-session by the unasked-call tripwire, after a POST /permission/skip-all to its own loopback listener made it run a shell command without asking:

MiMo Code chat: harness stopped by the tripwire

A chat with an invalid MiMo credential (auth.json removed before the process started and for the whole turn). MiMo Code 0.1.15 writes Invalid API Key only to its own log file and ends the turn end_turn with no content and no error frame, so the dashboard shows its empty-turn notice. A chat therefore never reaches signed_out_message on this harness today (the sign-in note on the detail card is sign_in_remedy); naming a sign-in failure in chat needs a signal the harness does not send, left for a follow-up:

MiMo Code chat with an invalid credential: the empty-turn notice

Related Issues

Closes #24711

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

@jief123
jief123 requested review from a team and KiroCrewCaptain as code owners October 27, 2026 05:31
@jief123
jief123 requested a review from chenmingwei23 October 27, 2026 05:31
@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 Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of cea97bed0d86a0946a7d094dc73491a813d2ac0e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the new harness is a separate, opt-in backend id with the same enforcement as OpenCode, and the shared paths it changes only run when backend == mimocode or for a set whose only member is mimocode.

Notes

  • _mimocode_governed_mcp_issue counts every mounted server, Crew's own control plane included. On any host where a policy or profile constrains mcp, MiMo Code will in practice refuse to start. Say this plainly on the harness card or in the setup docs, so users don't find out from a refused chat.
  • Keeping MiMo Code's launch and mirror (about 1,600 lines) as separate copies, rather than sharing OpenCode's, is a deliberate cost. When the fused-title MCP gap gets fixed, fix it once for both backends, as the description itself says; otherwise the two copies will drift apart.

[DESIGN-REVIEWED] cea97be

Description read

[DESCRIPTION-READ] e30512309278e450fb51025a1c5b80f55f4c60f7ae88eae63e384809a3c52b1f

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of cea97bed0d86a0946a7d094dc73491a813d2ac0e via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Two small surfaces have no consumer of their own; both are notes.

Notes

  • Item 9 — zero consumers: the patch greps 3 hits for is_mimocode_backend: its definition, a test call and a bindings-table row. Nothing in src/ reads it. The base siblings is_opencode_backend and is_pi_backend have 0 readers in src/ either, so it exists only for symmetry. Subtraction: delete the property from providers/acp.py and its row in test/test_acp_bindings.py.
  • Item 7 — one consumer, generalized: any_configured_profile_constrains(scope: str) has one caller, and that caller passes "mcp" (governance.py, return any_configured_profile_constrains("mcp")). Subtraction: drop the parameter and fix it to the mcp scope.

What this change ships

Inventory (10 items) — 8 justified

Intent: let a user pick MiMo Code as their agent harness and run Crew sessions on it with Crew's tool gate enforced. ADDITION.

  1. MiMo Code appears as a selectable harness in Settings → Agent Harness, and the default is unchanged — justified
  2. Launch seeds permission: "ask", reads it back and refuses the session when it does not hold — justified
  3. The agent spec's per-tool MCP denies reach MiMo Code through its own config — justified
  4. A tool call that completes without asking stops the session — justified
  5. Shell permissions are reordered so the command is known before the gate rules on it — justified
  6. MiMo Code sessions that would mount an MCP server are refused when governance constrains mcp — justified
  7. New public helper any_configured_profile_constrains(scope) — one consumer, generalized
  8. MiMo Code model labels drop the <provider>/ prefix in the picker — justified
  9. New AcpProvider.is_mimocode_backend property — zero consumers
  10. MIMOCODE_* env, token and config paths fenced, two new capability sets — justified

[FIRST-PRINCIPLES-REVIEWED] cea97be

Description read

[DESCRIPTION-READ] e08730ff9348e444fdc8a0af162049c44df21105edeeca6c7a85d3abff6322e0

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed cea97bed0d86a0946a7d094dc73491a813d2ac0e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] cea97be

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed cea97bed0d86a0946a7d094dc73491a813d2ac0e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] cea97be

@jief123

jief123 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author
  • Second copy of the shell-permission reorder

Rebutted: the separate copy is deliberate, and the reason is now stated at the code (_defer_mimocode_shell_permission docstring in acp/client_turn.py, and its timeout in acp/client_timeouts.py), head 063953c.
MiMo Code is a fork of OpenCode, not a build of it. It already differs on the wire: its tool ids (actor, a task that never asks), its permission categories, and its unauthenticated loopback routes, each captured under test/fixtures/acp_frames/mimocode.
This reorder decides whether the shell gate can read the command. Its frame order is a per-release fact of each harness (mimocode/session-live.jsonl holds both orders on 0.1.15), so each copy is judged against its own harness's captures, and a change tuned for one harness cannot silently move what the other's gate reads.
Sharing would also put MiMo Code under the opencode function and constant names, while the rest of the backend keeps out of the opencode namespace (its launch and mirror import nothing from the opencode modules).
Each copy has its own tests: test/test_acp_mimocode_turn.py covers every branch of the MiMo copy, including a replay of the recorded frames.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Oct 27, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of cea97bed0d86a0946a7d094dc73491a813d2ac0e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The six committed screenshots show every control this PR adds or changes, but no first-time reader has seen them because a fork gets no blind read. A maintainer can push the branch here to get one.

Notes

  • The MCP refusal (mimocode.py _mcp_governance_refusal, attachment-03) is a wall of roughly 110 words full of internal terms: "fused '_' name", "governance ceiling", "sensitive-path block". Lead with the fix, e.g. "MiMo Code can't run with this host's MCP rules. Remove the MCP rules, stop using MCP servers with MiMo Code, or pick another harness in Settings › Agent Harness." Move the explanation to a docs link.
  • The tripwire message (attachment-04) says "Start a new chat", but a Resume button sits right next to it. It also ends on a mechanism clause: "a request to its own loopback permission route, or an approval it stored earlier". Cut it to: "MiMo Code ran a shell command without asking Kiro Crew first, so it was stopped. Start a new chat."
  • The MiMo Code detail card (attachments 05/06) doesn't warn that a host with MCP rules will refuse every chat. Add that limit to the card so users learn it before they pick this harness, not from a red error after their first message.

[UX-REVIEWED] cea97be

Description read

[DESCRIPTION-READ] ba60266e77469d2a3c931ca6bb6c05041ecb5798f551a86b03fb9363f91e4ef4

That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 27, 2026
@jief123

jief123 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author
  • Second copy of the opencode launch, mirror and reorder — duplicate

Addressed in bcade7f by re-deriving the three pieces from MiMo Code 0.1.15's own source instead of OpenCode's, and keeping the rest separate on purpose.

What MiMo Code does differently, each now modelled where it was copied before:

  • Rule algebra: disabled() in permission/index.ts matches a rule against the tool's own id OR its group alias (edit: edit/write/apply_patch/multiedit; read: read/view_image), last match wins; OpenCode substitutes the group name first. Agent rules are appended after the top level, so an agent printed as permission: {} inherits. The old copy refused that config; measured on 0.1.15 that it starts.
  • Seed: under the string-only keys in config/permission.ts (e.g. doom_loop) a {"*": "deny"} makes MiMo Code reject the whole config (measured), so the seed writes a bare "deny". mimo debug config prints keys unmasked, so OpenCode's mask branch is gone and its stdout is never logged.
  • Mirror: the MCP array is merged by name with the later entry winning, as the harness does; only ids that collide with its edit/read groups (apply_patch, view_image) withhold a server whole.
  • Reorder: MiMo Code's bash ask carries rawInput: {} and the command arrives only on the next update (tool/bash.ts), while OpenCode 1.19.1 sends it on the ask. The MiMo function holds only the two command-less titles (bash, external_directory); bash_delete carries {command, deletes} and is judged at once.

Measured with names normalized and docstrings stripped: acp/harness/mimocode.py went from 13 of 29 top-level definitions byte-identical to opencode.py to 2 of 31 (settle_mimocode_denies and refuse_native_mount_of_unhonoured, the per-harness hooks the launch contract calls); providers/mirrors/mimocode.py from 4 of 8 to 1 of 10 (mimocode_tool_id, the <server>_<tool> id both harnesses spell); the reorder now scores 0.65 against _defer_opencode_shell_permission.

The no-import test stays: MiMo Code is a fork, and its security-relevant behaviour above already differs from OpenCode's, so a fix tuned for one must be judged against the other harness's own source and captures before it moves.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 28, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 28, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Requesting changes on a52bdb5. This replaces my approval of 44a3453, which carries the same patch. The GPT 6.1 lane found something on this head that I missed, and after reading the source I agree with it.

The finding holds. A write that MiMo Code makes inside its memory tree never reaches Kiro Crew's gate, so an operator ceiling on filesystem.write is not applied to it.

  • The memory tree is $XDG_DATA_HOME/mimocode/memory, or ~/.local/share/mimocode/memory (acp/harness/mimocode.py:161). It sits outside the session's working directory.
  • MiMo Code's edit tools write there without asking. The launch records the tree (mimocode.py:1069), and the unasked-call check then treats such a write as expected: _unasked_call_is_expected returns true when every target is inside it (acp/client_permissions.py:1346).
  • Crew applies filesystem.write when a permission request arrives. A write that is never asked about has no request, so no rule is read for it.
  • The only launch refusal is for the mcp scope (_mimocode_governed_mcp_issue, mimocode.py:790). Nothing refuses a session when filesystem.write is constrained.

So under a ceiling such as "writes only inside the workspace", the model can still create and change files under the memory tree, and those files are read back into later sessions. The check that runs afterwards cannot undo the write, and it does not flag it either.

How wide it is. It needs an operator who constrains filesystem.write. With the default open ceiling nothing changes. The reach is one directory: the path is resolved before the comparison, and test_a_memory_path_that_resolves_outside_the_tree_trips covers a link that points out of it. That limits the harm. It does not make the ceiling hold.

This is the same class the PR already solved for mcp. There the gate cannot see a call's identity, so the session is refused at launch and re-checked live. The memory tree is the second place where this harness acts without the gate seeing it, and it needs the same treatment.

What I am asking for.

  1. At launch, ask the governance evaluator whether a filesystem.write to the memory tree would be allowed outright under the installed ceiling and the configured profiles. If the answer is anything but allow, or cannot be resolved, refuse the session with a remedy, the way _mimocode_governed_mcp_issue does.
  2. Ask again live, on the same two paths the mcp re-check uses, because a ceiling can be installed after the start.
  3. Tests: an allow-mode filesystem.write ceiling that does not cover the memory tree refuses the launch; one that covers it does not; a ceiling installed mid-session stops the session; an unresolved store refuses.
  4. Use the evaluator's own path matcher for this. Please do not add a pattern of your own for it.

If MiMo Code has a setting that makes memory edits ask, seeding that instead would be simpler and I would take it, with a read-back that proves it is in force.

Not verified by me. I read the source and did not run MiMo Code. I did not test whether the OS sandbox lets the child write to that directory; if it does not, memory would not work at all, so I assume it does.

Everything else in my earlier review stands, including the actor script check.

@jief123

jief123 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@buluoray Thanks, agreed: the memory-tree exception let a write past a filesystem.write ceiling with nothing seeing it. I took the route you said you'd accept. MiMo Code 0.1.15 has a setting that turns those writes off, so it is seeded and read back in e0bc07ad29, and the exception is gone.

The setting. memory.disable_write is in 0.1.15's config schema (boolean, default false). Tool.assertWriteAllowed reads it through the config service and throws for any path under <data>/memory when it is true ("Memory WRITING is disabled ... every path under ... is refused"). It also turns off the checkpoint writer and the dream/distill runs that write there. In the shipped bundle edit, write and notebook_edit call assertWriteAllowed before askEditUnlessMemory, and apply_patch calls it for both ends of a move. So the write is refused before the skipped ask, on every tool that can reach that tree.

What changed.

  • _mimocode_routing_config now also sets memory.disable_write: true. Any other memory keys in the operator's inline config are kept, and an ambient false is overridden.
  • _verify_mimocode_routing refuses the session unless the resolved config has memory.disable_write exactly true. Checked against a real mimo debug config on 0.1.15 with the seed, which prints "memory": {"disable_write": true}.
  • _unasked_call_is_expected no longer exempts writes inside the memory tree. _unasked_write_outside_memory, _any_outside and _mimocode_memory_root are removed. An unasked completed write is now a tripwire stop wherever it lands.
  • This makes the answer the same under every ceiling, so there is no filesystem.write evaluation and no live re-check to add. A ceiling installed mid-session changes nothing, because the harness never writes there.
  • Tests: memory writing left on ({}, false, the string "true") refuses the session; the seed overrides an ambient false and keeps other keys; an unasked edit/write/notebook_edit inside the tree trips, as does one in the project.

Cost. MiMo Code's own memory files are not written in a Crew session, and its checkpoint rebuild falls back to compaction (the harness says so in the chat). Reading existing memory still works, and Crew keeps its own memory as before. Not driven live: the hosted model returns empty turns from this host, so the evidence is the read-back above and the bundle's code path.

buluoray
buluoray previously approved these changes Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving on e0bc07a. This supersedes my change request on a52bdb5: the memory-tree gap is closed, and closed the simpler way.

What I checked against the source on this head.

  • The seed. _mimocode_routing_config sets memory.disable_write to True and keeps any other memory keys the operator has (acp/harness/mimocode.py:627). An ambient false is overridden.
  • The read-back. _verify_mimocode_routing refuses the session unless the resolved config carries memory.disable_write as exactly True (mimocode.py:762). A missing key, false, and the string "true" all refuse. It reads the config MiMo Code itself resolved, so a later source that turns writing back on is caught.
  • The exception is gone. _unasked_call_is_expected no longer passes a file write. _unasked_write_outside_memory, _any_outside, _mimocode_memory_root and the client field are removed, and nothing in src/ refers to them. An unasked write that completes now stops the session wherever it lands.
  • No new pattern matching. The change adds no regex. The four in the PR are the same four as before.

Because the harness no longer writes there at all, the answer is the same under every ceiling. So the filesystem.write evaluation and the live re-check I asked for are not needed, and I agree with leaving them out.

Tests on this head. The test files this PR touches: 2092 passed, 1 failed. The one failure is test_harness_parity.py::test_is_kiro_cli_is_positive, which fails the same way on plain main on the machine I used.

What changed since a52bdb5. The branch was rebased onto main at 9cc553f. Fourteen files differ from the patch I last read, all for this fix: the two source files above, four more source files that carried the removed field or its wording, three specs, one user doc, and four test files.

The cost, stated so nobody is surprised later. MiMo Code's own memory files are not written in a Kiro Crew session, and its checkpoint rebuild falls back to compaction. Reading existing memory still works. Kiro Crew's own memory is unaffected.

Not verified by me.

  • I did not run MiMo Code. That memory.disable_write makes every edit tool refuse a path under the memory tree is the author's reading of 0.1.15, which I could not check. The unasked-call check is the second line behind it: if a later release ignored the setting, the first such write would stop the session.
  • CI on this head had only started when I posted this.

Not blocking, for later: #35740 proposes moving per-harness state and branches onto the adapters, and this harness would move with OpenCode there.

@jief123

jief123 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@buluoray Thanks for the approval at e0bc07ad29. All five AI lanes passed on that head, GPT 6.1 included. Main then conflicted with it in three files: #31950 added a codex tool table next to MiMo Code's.

3fa8023b42 is the rebase. Its one change beyond conflict resolution is in HARNESS_TOOL_MATCH_VOCABULARY. That set now names codex beside claude, so codex's ids (exec_command, write_stdin, shell) still quiet the spec reader's "names no tool" warning, as they do on main. The vocabulary differs from main's only by MiMo Code's own actor, notebook_edit and view_image. test_spec_hook_kas_tool_names.py pins both sides: codex is listed outside ACP_BACKENDS_CREW_FIRES_SPEC_HOOKS, and codex's ids are added to the no-warning test.

Could you take another look? Sorry for the extra round.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving on 3fa8023. The push reset my approval of e0bc07a, so this is a read of what moved.

What moved. The branch was rebased onto main at df73916, after #31950 added a codex tool table. I compared the patch file by file against the one I approved. Three files differ and the rest are identical:

  • src/kiro_crew/acp/harness_tool_names.py: HARNESS_TOOL_MATCH_VOCABULARY now keeps codex beside claude.
  • test/test_spec_hook_kas_tool_names.py: the same two facts pinned.
  • docs/system-specs/modules/agent-host-contract.md: the conflict in two table rows.

The one change beyond conflict resolution is right. This PR narrows the vocabulary so MiMo Code's ids are left out, because its spec hooks are withheld. Main's new codex table would have been dropped by that filter. I built the set on both sides:

  • On this head: 35 ids. The ids left out are exactly actor, notebook_edit and view_image.
  • On main (df73916): 35 ids, and the two sets are equal.

So every id that quiets the "names no tool" warning on main still does, codex's included, and only MiMo Code's own three still warn.

Tests on this head. The test files this PR touches, plus test_harness_tool_names.py: 2135 passed, 1 failed. The one failure is test_harness_parity.py::test_is_kiro_cli_is_positive, which fails the same way on plain main on the machine I used.

Everything in my review of e0bc07a stands, including what I could not verify there: I did not run MiMo Code itself.

CI on this head had only started when I posted this.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Requesting changes on 3fa8023 for one sentence. This replaces the approval I posted on this head earlier today. The Opus 5.5 lane found it, I checked it against the source, and it is right. I missed it.

A shipped user doc says a control runs that does not run.

src/kiro_crew/docs/agent-spec-fields.md:212 says:

mimocode is mirrored and enforced like opencode, and the refusal does run on its sessions, but some of MiMo Code's own tools (memory, history, task) never send a permission request, so they stay callable under tools: []

The code does the opposite:

  • ACP_BACKENDS_HONOR_ZERO_TOOL_BAN (agent_sdk/backends_mcp.py:428) subtracts ACP_BACKENDS_UNASKED_NATIVE_TOOLS, and MiMo Code is that set's one member (:337).
  • So AcpClient._enforces_zero_tool_ban (acp/client_class.py:910) is false on a MiMo Code session, and _deny_zero_tools returns before it refuses anything.
  • The spec says so correctly: agent-host-contract.md:781 reads "gap: the refusal does not run (honors_zero_tool_ban is False)".

An operator who reads the user doc will believe that "tools": [] on MiMo Code leaves only memory, history and task callable. In fact a bash, write or edit request is answered like any other request, and approved under auto-approve. The two docs in this PR disagree, and the one that ships to users is the wrong one.

What I am asking for. One of:

  1. Change the sentence to say the refusal does not run on MiMo Code and that an agent spec relying on tools: [] there is not enforced, in the same words the codex paragraph above it uses. This is the smaller change and it matches the code.
  2. Or keep _deny_zero_tools running on MiMo Code for the calls that do ask, and say in both docs that memory, history and task still run. That is the stronger behaviour, but it changes what membership in ACP_BACKENDS_HONOR_ZERO_TOOL_BAN means, so I would not ask for it in this PR.

I will re-approve as soon as either lands.

Lanes on this head. Design, UX and First Principles pass. Opus 5.5 blocks on the point above. GPT 6.1 reports "review incomplete", which is the lane not finishing and carries no finding.

Everything else in my review of this head stands, including the vocabulary check.

@jief123

jief123 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Opus 5.5 Review on 3fa8023b42, fixed in d650c94102:

  • BLOCKING (src/kiro_crew/docs/agent-spec-fields.md:211, defect): fixed in the doc. The finding is right. ACP_BACKENDS_UNASKED_NATIVE_TOOLS is subtracted from ACP_BACKENDS_HONOR_ZERO_TOOL_BAN, so _deny_zero_tools returns early on mimocode, and the shipped doc wrongly said the refusal runs. The sentence now says it does not run, as agent-host-contract.md already did: memory, history and task never ask, so no refusal could hold tools: [], and a spec relying on it on mimocode is not enforced. The code is unchanged. Refusing only the calls that ask would still not make a zero-tool spec hold, and this PR deliberately does not claim a partial ban.

@buluoray This push changes only that paragraph of agent-spec-fields.md since your approval of 3fa8023b42, plus a clean rebase onto main.

buluoray
buluoray previously approved these changes Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving on d650c94. This supersedes my change request on 3fa8023: the sentence I asked about now says what the code does.

The fix. src/kiro_crew/docs/agent-spec-fields.md:212 now says the tools: [] refusal does not run on MiMo Code sessions, that a call which asks is judged like any other, and that an agent spec relying on tools: [] there is not enforced. That matches ACP_BACKENDS_HONOR_ZERO_TOOL_BAN, AcpClient._enforces_zero_tool_ban, and the row in agent-host-contract.md. The two docs agree now.

I agree with leaving the code as it is. Refusing only the calls that ask would still let memory, history and task run, so it could not make a zero-tool spec hold, and a partial ban described as a ban is worse than a stated gap.

What moved since 3fa8023. The branch was rebased onto main at 6e9c7c8. I compared the patch file by file against the one I read on the last head. One file differs, agent-spec-fields.md, and only in that paragraph. Every other file's patch is identical.

Tests. I did not re-run the suite for a one-paragraph doc change. My run on 3fa8023 stands for the code: 2135 passed, with one failure that also fails on plain main on the machine I used. This head sits on a newer main, and I did not run the tests on that base myself; CI on this head covers it and had only started when I posted this.

Everything else in my earlier reviews stands, including what I could not verify: I did not run MiMo Code itself.

@jief123

jief123 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@buluoray Thanks for the approval at d650c94102. Main then conflicted again, twice, both in agent-host-contract.md: #35260 reworded the Codex session-store cells and #33578 a KAS hooks cell. cea97bed0d is the rebase, with main's text taken and the MiMo Code cells unchanged.

The rebase pushed the diff a few bytes past the 1 MB review cap, so I shortened some MiMo Code prose that restates other docs in this PR. These are three host-contract cells and the worked example's residual row and closing paragraph in harness-onboarding.md; no fact was removed. There is no code change since your approval.

On d650c94102 the GPT 6.1 lane reported "review incomplete" again, the lane not finishing, as you noted on the previous head. It reruns on this push.

buluoray
buluoray previously approved these changes Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving on cea97be. The push reset my approval of d650c94, so this is a read of what moved.

What moved. The branch was rebased onto main at cec6f7a. I compared the patch file by file against the one I approved. Two files differ, both docs, and every other file's patch is identical. There is no code or test change.

  • docs/system-specs/modules/agent-host-contract.md: main's new text for the Codex session-store cells and the KAS hooks cell is taken as it is, and three MiMo Code cells are shortened.
  • docs/system-specs/modules/harness-onboarding.md: the worked example's residual row and its closing paragraph are shortened.

The facts I care about are still there. The host contract still says the tools: [] refusal does not run on MiMo Code, and both docs still name memory.disable_write and why it is seeded.

Tests. No code moved, so I did not re-run the suite. My run on 3fa8023 stands for the code: 2135 passed, with one failure that also fails on plain main on the machine I used. I did not run the tests on this newer base myself; CI on this head covers it and had only started when I posted this.

Lanes. GPT 6.1 reported "review incomplete" on the last two heads, which is the lane not finishing. Its last finished read was on e0bc07a, with no findings. It runs again on this push.

Everything else in my earlier reviews stands, including what I could not verify: I did not run MiMo Code itself.

MiMo Code (npm @mimo-ai/cli, `mimo acp`) is a fork of OpenCode with
its own config variable, tools and loopback listener, so pointing the
opencode backend at it never delivers Crew's permission seed. Add it
as its own backend, `mimocode`, selectable and enforced through
VERIFIED_SEEDED_SETTINGS.

The launch (acp/harness/mimocode.py) and mirror
(providers/mirrors/mimocode.py) import nothing from the opencode
modules. The launch seeds `permission: "ask"` through
MIMOCODE_CONFIG_CONTENT, reads it back from `mimo debug config`, gates
the 0.1 line, refuses MIMOCODE_HOME, strips the switches the read-back
cannot see and pins cron, the experimental toolsets and codex mode off.

Where the fork differs from OpenCode on the wire, the difference lives
in a per-backend table: its tool ids (`use_subagent` is `actor`) and
argument spellings (`notebook_path`, `patch_text`), so the shared
readers are unchanged. A tripwire stops the harness when a call
completes unasked, other than the few tools the harness never asks for
and writes inside its memory tree, or when a call completes before Crew
answered its ask: what the listener's unauthenticated skip-all and
reply routes produce. `always` is sent as `once` so no stored grant
hides an asked call.

Some native tools (memory, history, task) never ask, so the backend
sits outside the zero-tool honor set. agent.env refuses MIMOCODE_*,
and the fork's credential, global config and project config are on
the write-only tier. Seven live captures off 0.1.15 cover all seven
frame classes.

Part of kirodotdev#24711
@jief123

jief123 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@buluoray Thanks for the approval at cea97bed0d. Main moved under it again, and 32bf88a15e is the rebase. Changes since your approval:

  • Conflict with fix(acp): refuse codex permission requests when the spec has no tools #35508 (codex now refuses permission requests under tools: []) in agent-spec-fields.md and the host-contract table: I kept main's codex text, and the MiMo Code paragraph and cells are unchanged.
  • Main's new pin in test_usage_harness_sessions.py (fix(usage): count sessions of every ACP harness in Session Activity #35838) requires every known harness to be counted from usage rows or from a transcript. MiMo Code writes no transcript the Session Activity parse reads, so it joins _SHARD_COUNTED_HARNESSES beside OpenCode (dashboard/handlers/usage_store.py, plus the facade's type-checker list in usage.py and the list in learn-cron-dashboard.md).
  • One stale sentence fixed. The host-contract Format cell said the inline config carries only the permission setting and the deny rules. It now also names memory.disable_write.
  • Diff budget. The rebases pushed the diff past the 1 MB review cap, so I shortened MiMo Code prose that restates other docs (host-contract cells, the onboarding worked example, the acp-client.md MCP and shell paragraphs, the fixture README row) and two long code comments. No fact or behaviour changed.

Could you take another look? Sorry for the repeated rounds; main is moving fast today.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving on 32bf88a. The push reset my approval of cea97be, so this is a read of what moved.

What moved. The branch was rebased onto main at 0fc3b49. I compared the patch file by file against the one I approved. Nine files differ, and every other file's patch is identical.

  • One code change, required by main. #35838 added a pin that every known harness is counted from usage rows or from a transcript. MiMo Code joins _SHARD_COUNTED_HARNESSES in src/kiro_crew/dashboard/handlers/usage_store.py, beside OpenCode, with the matching name in the type-checking list in usage.py and in learn-cron-dashboard.md. That is the right set for a harness with no transcript the Session Activity parse reads.
  • src/kiro_crew/acp/harness/mimocode.py: comments only. I compared the added lines that are not comments on both heads, and they are the same.
  • Docs. The host-contract table takes main's new codex text from #35508, with the MiMo Code cells unchanged, and its Format cell now names memory.disable_write. The MiMo Code paragraph in agent-spec-fields.md is the same as on the last head. The rest is MiMo Code prose shortened in acp-client.md, agent-host-contract.md, harness-onboarding.md, the fixture README, and one comment block in test_acp_mimocode_turn.py.

Tests on this head. The test files this PR touches, plus test_usage_harness_sessions.py and test_harness_tool_names.py: 2150 passed, 1 failed. The one failure is test_harness_parity.py::test_is_kiro_cli_is_positive, which fails the same way on plain main on the machine I used.

Everything else in my earlier reviews stands, including what I could not verify: I did not run MiMo Code itself.

CI on this head had only started when I posted this.

@LuisBrel LuisBrel mentioned this pull request Nov 13, 2026
5 tasks done
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MiMo Code as an ACP backend (mimocode)

3 participants