Skip to content

fix(mimocode): refuse a chat that would answer from Xiaomi's hosted model unsigned - #37629

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/mimocode-hosted-fallback
Nov 16, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/mimocode-hosted-fallback

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a MiMo Code chat on a host with no Xiaomi sign-in is stopped with a notice that names the fix, instead of quietly sending the prompt to Xiaomi's hosted model.

MiMo Code is built on opencode and has the gap #37480 closed for opencode. Measured on MiMo Code 0.1.17 from a scratch home with no sign-in, no key and no model in its config: session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed, advertises three xiaomi/ models, and the first prompt goes to api.xiaomimimo.com/v1/chat/completions with no Authorization header. Crew showed nothing, because the start-time check runs for opencode only.

Why it matters

An operator who picked MiMo Code and has not signed in has their chats, and whatever the model reads in the work dir, sent to a hosted service without a sign-in they made, with no sign that it happened.

Not a goal

  • The pooled-session model path (session_handle_model_selection.ensure_served_default), which has no hosted-fallback check for opencode either. Predates this change.
  • MiMo Code's other outbound calls seen in the same runs (telemetry, model catalog).

What changed (motivation → approach → change)

  1. Same refusal, MiMo Code's own client class. Following refactor(acp): move the opencode session code off AcpClient into OpencodeAcpClient #37602's split, a new MimocodeAcpClient(AcpClient, serves=mimocode) (acp/client_mimocode.py, bound from the new owner acp/client_mimocode_session.py) fills only the _refuse_harness_default_model hook that _ensure_served_default and the refused-pin exit of _apply_startup_model already call. AcpClient(acp_backend="mimocode") now builds it; the base hook is unchanged. The test is a new is_mimocode_hosted_fallback (acp/no_model_provider.py), sharing _only_hosted with opencode's: the current model and every advertised model carry the hosted prefix (xiaomi/ here). opencode's behaviour is unchanged. The new owner joins _CLIENT_OWNERS (acp/client.py) and NON_EGRESS_REDACTION_MODULES (security_posture.py), as opencode's did.
  2. Signed-in hosts pass. A signed-in host advertises the very same models, so MiMo Code's read-back (_verify_mimocode_routing) records HarnessReadBack.hosted_credential through _mimocode_hosted_credential_present: True when XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT is set in the child's environment, when the resolved config gives provider.xiaomi.options.apiKey (_mimocode_config_has_xiaomi_key; measured: MiMo Code sends it as the bearer and advertises the same three models), or when the sign-in file the auth declaration names exists ($XDG_DATA_HOME/mimocode/auth.json when that is set, else ~/.local/share/mimocode/auth.json). Presence only: the file is never opened. The paths come from the existing host_auth declaration, not new literals.
  3. Config model passes. The read-back also records model from mimo debug config into config_model, as opencode's does.
  4. Same refusal. AcpNoModelProvider, non-transient and not retried, with mimocode_hosted_fallback_message naming MiMo Code's signed-out message and the pick-a-model fix.

Backwards compatibility

Breaking, narrowly: a MiMo Code host with no sign-in file, no Xiaomi key in the environment and no model in its config used to chat on Xiaomi's hosted model and is now refused until it signs in, names a model, or picks one. Hosts signed in with mimo providers login are unchanged. A host whose Xiaomi key is provider.xiaomi.options.apiKey in mimocode.json is unchanged too. Removes nothing.

Tests

Proof: not provable -- other: proved by manual revert, see the list below

Manual revert, each with the new tests kept: the hook binding removed from MimocodeAcpClient → 2 tests fail (test_no_sign_in_refuses_before_any_prompt, test_a_refused_pin_that_leaves_the_hosted_default_is_refused); _mimocode_hosted_credential_present forced to False → 3 fail (test_the_sign_in_file_exists, test_the_sign_in_file_under_xdg_data_home, test_xiaomi_api_key_is_set); _mimocode_config_has_xiaomi_key forced to False → test_a_key_in_the_harness_config fails.

New test/test_acp_mimocode_hosted_fallback.py, with the model list from the live run:

  • refused: no sign-in (no model write sent); a refused pin that leaves the hosted default.
  • left alone: a sign-in present; model named in the harness config; an own provider beside the hosted list.
  • presence: nothing signed in; the sign-in file (contents not JSON, never parsed); the file under XDG_DATA_HOME; XIAOMI_API_KEY; the read-back records the config model, and counts a non-blank provider.xiaomi.options.apiKey (a blank one does not), with every MIMOCODE_*, XIAOMI_API_KEY and XDG_DATA_HOME cleared so the runner's shell cannot steer it.

Related suites run locally: 98 test files touching MiMo Code, model selection, served default, the read-back, the client owners and the redaction posture: 7023 passed, 1 skipped. test/test_client_bindings.py gains MimocodeAcpClient's member inventory; its class-pick test now expects MimocodeAcpClient for mimocode and keeps pi as the backend that builds the base class. black, isort, flake8, mypy, semgrep diff scan and the flake-pattern ratchet pass. Local GPT and Opus reviews: PASS.

Manual verification

Measured against MiMo Code 0.1.17 before the fix, over ACP, scratch home, all outbound HTTPS to a refusing local proxy, Xiaomi's base URL pointed at a local fake model: no credential → prompt sent with no Authorization; a sign-in file → same advertised list, prompt sent with Bearer. The fixed build was not re-driven against a live MiMo Code; the unit tests replay the captured list.

Related Issues

Closes #37628

Sibling sweep

Swept: git grep -n "_refuse_harness_default_model" -- src/kiro_crew/acp
Sibling: src/kiro_crew/acp/client_opencode_session.py -- not affected -- opencode's own hook, unchanged
Sibling: src/kiro_crew/acp/session_handle_model_selection.py -- not affected -- pooled path has no hosted-fallback check for any harness; out of scope

Pattern harvest

Not generalizable: the condition is read from each harness's own default-model behaviour; opencode and MiMo Code are the two that start on a hosted model unasked.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

Contributions are accepted under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 15, 2026 14:39
@iamwhatever
iamwhatever requested a review from buluoray November 15, 2026 14:39
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 804a2ee443741bc7ecb27ceb397f46f2dd940b0f touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 804a2ee443741bc7ecb27ceb397f46f2dd940b0f — 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

This closes an unsigned hosted-model egress gap with the same hook opencode already fills. It adds no knob and no duplicate, and nothing in it needs a product-shape decision.

Not checked: whether MiMo Code 0.1.17 really advertises identical xiaomi/ models when signed in and when signed out.

What this change ships

Inventory (7 items) — 7 justified

Intent: stop a MiMo Code chat on a host with no Xiaomi sign-in from quietly sending prompts to Xiaomi's hosted model (FIX, #37628).

  1. A MiMo Code chat with no sign-in, no key and no config model is now refused before its first prompt — justified
  2. A host is treated as signed in when the sign-in file exists, XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT is set, or the config sets provider.xiaomi.options.apiKey — justified
  3. A model named in mimocode.json now lets the session through — justified
  4. The read-back gains a hosted_credential fact, with one consumer (the mimocode refusal) — justified
  5. A new refusal notice names the MiMo Code sign-in and the pick-a-model fix — justified
  6. opencode's hosted-fallback test now shares _only_hosted with MiMo Code's, and opencode's behaviour is unchanged — justified
  7. The new session owner joins _CLIENT_OWNERS and NON_EGRESS_REDACTION_MODULES — justified

[FIRST-PRINCIPLES-REVIEWED] 804a2ee

Description read

[DESCRIPTION-READ] 84f1f7e073ed0d59857d8bfe41ead2bbc71e8f53ee4486c139402e7e45d37569

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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 804a2ee443741bc7ecb27ceb397f46f2dd940b0f — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change reuses opencode's existing refusal hook and adds a sign-in presence check, so signed-in hosts and hosts with a model set still pass.

Notes

  • The live fixed build was never re-driven. One run against MiMo Code 0.1.17 with a sign-in file and one without would confirm the refusal fires only when no sign-in exists, not on a signed-in host.

[DESIGN-REVIEWED] 804a2ee

Description read

[DESCRIPTION-READ] 92b6dff06106c23b926e95116b362fd178ba9c31012a164ef10b91ac28ec27c0

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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 804a2ee443741bc7ecb27ceb397f46f2dd940b0f and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 804a2ee

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 804a2ee443741bc7ecb27ceb397f46f2dd940b0f false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 804a2ee443741bc7ecb27ceb397f46f2dd940b0f — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 804a2ee

Verdict parsed from the review's SHA-scoped output markers for commit 804a2ee443741bc7ecb27ceb397f46f2dd940b0f.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 804a2ee443741bc7ecb27ceb397f46f2dd940b0f false-positive: <reason, 20 to 500 characters>

@iamwhatever
iamwhatever force-pushed the fix/mimocode-hosted-fallback branch from 2a25607 to 44d3e23 Compare November 15, 2026 15:18
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

Adds MimocodeAcpClient, which fills the existing _refuse_harness_default_model hook (the same pattern as opencode). Both callers are reached for mimocode: it takes its model via a config option, not at launch. The routing read-back now records config_model and a hosted_credential flag, worked out by existence only (env keys, the sign-in file path from the host_auth declaration, a non-blank provider.xiaomi.options.apiKey) from the same child env the spawn uses. Behaviour fails closed, opencode is unchanged, and new tests cover refusal, every pass-through case and each credential check. Nothing blocks.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 804a2ee443 · 354 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026
@iamwhatever
iamwhatever force-pushed the fix/mimocode-hosted-fallback branch from 44d3e23 to cae830c Compare November 15, 2026 16:48
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @iamwhatever posted a complete reasoning template for 804a2ee.

@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 readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 15, 2026
…odel unsigned

MiMo Code 0.1.17 is built on opencode and has the gap #37480 closed there. With no sign-in, no key and no model in its config, session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed and the first prompt goes to Xiaomi's API with no Authorization header. Crew did not stop it: the start-time refusal ran for opencode only.

Following #37602's split, a new MimocodeAcpClient (acp/client_mimocode.py, bound from client_mimocode_session) fills the _refuse_harness_default_model hook; AcpClient(acp_backend="mimocode") now builds it. It refuses when the session's model and every advertised model are xiaomi/ ones, the harness config names no model, and no Xiaomi credential is present. A signed-in host advertises the very same models, so MiMo Code's read-back records that last fact: the sign-in file the auth declaration names (under XDG_DATA_HOME or HOME), XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT in the child's environment, or a provider.xiaomi.options.apiKey in the resolved config. The file is checked for existence only and never opened; the key is checked for presence and never logged. A signed-in host, a model named in mimocode.json, a Crew pin, or a provider of the operator's own is left alone.
@iamwhatever
iamwhatever force-pushed the fix/mimocode-hosted-fallback branch from cae830c to 804a2ee Compare November 16, 2026 08:50
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 16, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 804a2ee
  • What rule changed: NON_EGRESS_REDACTION_MODULES in src/kiro_crew/security_posture.py gains one entry, acp/client_mimocode_session.py, the new owner of MiMo Code's hosted-fallback refusal. It is the same entry refactor(acp): move the opencode session code off AcpClient into OpencodeAcpClient #37602 added for acp/client_opencode_session.py.
  • Before -> after (what was allowed/blocked, now): Before, the new module did not exist. After, the posture list records that this module calls redact_exfiltration_urls / redact_credentials on the model id it puts in the refusal text, and that it sends nothing off the machine. No gate, rule or allowlist is loosened; the list only names modules that redact without egress.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The posture test classifies the module wrongly, so a future edit that removed the redaction would not be flagged by that test. Nothing at runtime changes: the list is read by the posture tests, not by the gate.
  • Evidence checked (which sandbox result proves it): src/kiro_crew/acp/client_mimocode_session.py _refuse_harness_default_model redacts the model id before raising AcpNoModelProvider; it opens no socket and calls no client. The sign-in file is checked with Path.is_file() only and never opened; the config key is checked for presence and never logged.
  • No regression:
    • Tools still work (which tools/commands were run, result): Live MiMo Code 0.1.17 over ACP from a scratch home with a refusing proxy and a local fake model: signed in by auth.json, by XIAOMI_API_KEY, and by provider.xiaomi.options.apiKey in mimocode.json each reach the model with a bearer; only the unsigned case would be refused.
    • Backward compatible (old config / old data / old callers still work, how checked): Signed-in MiMo Code hosts, a model in mimocode.json, a Crew pin, and every other backend are unchanged; test/test_client_bindings.py pins that pi still builds the base AcpClient and opencode still builds OpencodeAcpClient.
    • Existing tests (which suites passed on this head): 4548 passed, 1 skipped across MiMo Code, client bindings, harness parity, model selection, served default and security-posture suites; flake-pattern ratchet 71 passed; semgrep diff scan clean.
  • How to undo: Revert the PR's single commit; the posture entry and the module go together.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 16, 2026 10:11

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked this head and found no blocking issue. MimocodeAcpClient fills the existing _refuse_harness_default_model hook through a positive serves=ACP_BACKEND_MIMOCODE class, so the Kiro path does not change. The credential check runs off the event loop, inside the read-back that runs on every spawn, and uses the same scrubbed child env the spawn uses. The refusal text redacts the model id. The _only_hosted refactor leaves opencode's behaviour the same. With the hook binding removed, both refusal tests fail, so the main refusal is pinned.

Done well: the PR reuses the host_auth MiMo Code declaration for every path and only checks that the sign-in file exists. It never opens that file.

Optional:

  • No test covers the read-back's use of _mimocode_hosted_credential_present(env) (mimocode.py:761). If that call is dropped, every signed-in host is refused and no test fails. A read-back case with a sign-in file under tmp_path, or with XIAOMI_API_KEY set, would catch it. A sibling test for MIMOCODE_AUTH_CONTENT would also help.
  • The Backwards compatibility section says both "Breaking, narrowly" and "Removes nothing." Removing "Removes nothing." would make it consistent.
  • The presence check counts a sign-in file for any provider. The docstrings already say this check is presence-only. If it ever matters, record it as a known limit.

@KiroCrewCaptain
KiroCrewCaptain merged commit c7c9357 into main Nov 16, 2026
99 of 100 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/mimocode-hosted-fallback branch November 16, 2026 10:11
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 16, 2026
buluoray pushed a commit that referenced this pull request Nov 19, 2026
…odel unsigned (#37629)

MiMo Code 0.1.17 is built on opencode and has the gap #37480 closed there. With no sign-in, no key and no model in its config, session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed and the first prompt goes to Xiaomi's API with no Authorization header. Crew did not stop it: the start-time refusal ran for opencode only.

Following #37602's split, a new MimocodeAcpClient (acp/client_mimocode.py, bound from client_mimocode_session) fills the _refuse_harness_default_model hook; AcpClient(acp_backend="mimocode") now builds it. It refuses when the session's model and every advertised model are xiaomi/ ones, the harness config names no model, and no Xiaomi credential is present. A signed-in host advertises the very same models, so MiMo Code's read-back records that last fact: the sign-in file the auth declaration names (under XDG_DATA_HOME or HOME), XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT in the child's environment, or a provider.xiaomi.options.apiKey in the resolved config. The file is checked for existence only and never opened; the key is checked for presence and never logged. A signed-in host, a model named in mimocode.json, a Crew pin, or a provider of the operator's own is left alone.

Co-authored-by: Joe Guo <zejiangg@amazon.com>
(cherry picked from commit c7c9357)
buluoray pushed a commit that referenced this pull request Nov 19, 2026
…odel unsigned (#37629)

MiMo Code 0.1.17 is built on opencode and has the gap #37480 closed there. With no sign-in, no key and no model in its config, session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed and the first prompt goes to Xiaomi's API with no Authorization header. Crew did not stop it: the start-time refusal ran for opencode only.

Following #37602's split, a new MimocodeAcpClient (acp/client_mimocode.py, bound from client_mimocode_session) fills the _refuse_harness_default_model hook; AcpClient(acp_backend="mimocode") now builds it. It refuses when the session's model and every advertised model are xiaomi/ ones, the harness config names no model, and no Xiaomi credential is present. A signed-in host advertises the very same models, so MiMo Code's read-back records that last fact: the sign-in file the auth declaration names (under XDG_DATA_HOME or HOME), XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT in the child's environment, or a provider.xiaomi.options.apiKey in the resolved config. The file is checked for existence only and never opened; the key is checked for presence and never logged. A signed-in host, a model named in mimocode.json, a Crew pin, or a provider of the operator's own is left alone.

Co-authored-by: Joe Guo <zejiangg@amazon.com>
(cherry picked from commit c7c9357)
buluoray pushed a commit that referenced this pull request Nov 19, 2026
…odel unsigned (#37629)

MiMo Code 0.1.17 is built on opencode and has the gap #37480 closed there. With no sign-in, no key and no model in its config, session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed and the first prompt goes to Xiaomi's API with no Authorization header. Crew did not stop it: the start-time refusal ran for opencode only.

Following #37602's split, a new MimocodeAcpClient (acp/client_mimocode.py, bound from client_mimocode_session) fills the _refuse_harness_default_model hook; AcpClient(acp_backend="mimocode") now builds it. It refuses when the session's model and every advertised model are xiaomi/ ones, the harness config names no model, and no Xiaomi credential is present. A signed-in host advertises the very same models, so MiMo Code's read-back records that last fact: the sign-in file the auth declaration names (under XDG_DATA_HOME or HOME), XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT in the child's environment, or a provider.xiaomi.options.apiKey in the resolved config. The file is checked for existence only and never opened; the key is checked for presence and never logged. A signed-in host, a model named in mimocode.json, a Crew pin, or a provider of the operator's own is left alone.

Co-authored-by: Joe Guo <zejiangg@amazon.com>
(cherry picked from commit c7c9357)
buluoray pushed a commit that referenced this pull request Nov 19, 2026
…odel unsigned (#37629)

MiMo Code 0.1.17 is built on opencode and has the gap #37480 closed there. With no sign-in, no key and no model in its config, session/new puts the session on xiaomi/mimo-v2.6-pro-ultraspeed and the first prompt goes to Xiaomi's API with no Authorization header. Crew did not stop it: the start-time refusal ran for opencode only.

Following #37602's split, a new MimocodeAcpClient (acp/client_mimocode.py, bound from client_mimocode_session) fills the _refuse_harness_default_model hook; AcpClient(acp_backend="mimocode") now builds it. It refuses when the session's model and every advertised model are xiaomi/ ones, the harness config names no model, and no Xiaomi credential is present. A signed-in host advertises the very same models, so MiMo Code's read-back records that last fact: the sign-in file the auth declaration names (under XDG_DATA_HOME or HOME), XIAOMI_API_KEY or MIMOCODE_AUTH_CONTENT in the child's environment, or a provider.xiaomi.options.apiKey in the resolved config. The file is checked for existence only and never opened; the key is checked for presence and never logged. A signed-in host, a model named in mimocode.json, a Crew pin, or a provider of the operator's own is left alone.

Co-authored-by: Joe Guo <zejiangg@amazon.com>
(cherry picked from commit c7c9357)
bolichen97 added a commit that referenced this pull request Nov 19, 2026
… main (#39387)

Backports to release/0.13.0 the fixes from #39342, squashed into one
commit and brought up to date with release/0.13.0 after the Kiro Memory
preview backport (#39360). Picks, in order; each [pick sha] is the
commit on the #39342 branch, whose body has main's cherry-picked-from line:

- fix(monitor): wake the session once when its watched PR merges or closes (#37776) [pick 84da419]
- fix(security): match deny rules against Windows program suffixes and cmd/PowerShell in-word escapes (#33569) [pick e4941b7]
- fix(mimocode): refuse a chat that would answer from Xiaomi's hosted model unsigned (#37629) [pick 1bfdce3]
- fix(acp): end a quiet agent-started cycle on the shared runtime's stale gate (#37932) [pick fa870a2]
- fix(conductor): re-read goal-conductor after a compaction (#37917) [pick ccdd67c]
- fix(security): refuse a command nested past 32 substitutions before the floors walk it (#37875) [pick 2f9bd67]
- fix(mates): carry a moved Bot's shell toolsSettings entry as execute_bash instead of holding it (#37973) [pick 16022f4]
- fix: hold an app to its own sessions, jobs and runs (#37804) [pick 3dff0c0]
- fix(acp): keep a KAS chat's stored record when its resume fails after the load (#37955) [pick 6ceb7b5]
- fix(gateway): ignore a repeat SIGTERM during graceful shutdown (#38031) [pick b48287d]
- fix(security): keep a quote in a $( ) from hiding a later ssh (#37558) [pick b9fed61]
- fix(agent): rebuild takes a server's disabledTools from the kiro global (#38147) [pick c50bbcc]
- fix(mcp_gateway): keep the backend when a stub leaves an open listen (#38121) [pick 3e9c7f9]
- fix: refresh plan and model list after a kiro-cli sign-in to another account (#38053) [pick 5ad3d36]
- fix(slack): keep a picture sent in a linked thread for the dashboard turn (#38076) [pick 7f8903e]
- fix: keep a resolved tool policy when the gateway is too slow to answer (#36669) [pick 9be5691]
- fix: open owner-only files and prune overlay folders without following links (#36994) [pick 6a1acc9]
- fix: refuse the local token mint to app backends (#38113) [pick d166dab]
- fix(subagent): hold a spawn's first prompt for its MCP servers (#38127) [pick e3e0298]
- fix(security): refuse a headless git --output write with no approver (#36326) [pick 1abee40]
- fix(restore): require an explicit mode, never default to replace (#38094) [pick ca86c06]
- fix: make the deny gate's shell walk linear in command length (#36437) [pick 22c100b]
- fix(chat): let a cancelled background start finish its session teardown (#36664) [pick b1dd34f]
- fix(acp): refuse a start when two differing specs declare the agent's name (#38411) [pick 80ccfff]
- fix: probe a silent turn while its co-tenant keeps the process busy (#38662) [pick 6354490]
- fix(kas): let a reopened chat switch to models its load select omits (#38376) [pick 1640822]
- fix(cloud): install a patched node 22 on run on aws instances (#38732) [pick 059cb90]
- fix: write member record files without following links (#37303) [pick aac9642]
- fix: fail a kas start fast once the host has turned its mcp off (#38677) [pick e147238]
- fix(decisions): fall back to HTTP/1.1 when h2 is missing (#38759) [pick fc16482]
- fix(mcp_gateway): free a spawn permit when its backend exits before initialize (#38793) [pick a084ba2]
- fix(kas): start an app chat whose tool policy hides every kirocrew-cron tool (#38761) [pick ccea5a9]
- fix(acp): give the tool-stall watchdog a margin over native waits (#34117) [pick b5d9e89]
- fix(mcp): bind the working-folder answer to its launch; observe launch changes behind name grants (#38983) [pick a1069be]
- fix(mcp): hide the gateway secret files from the npm install and third-party probe spawns (#39000) [pick 14d8571]
- fix(sandbox): fold env name case on Windows in the agent env scrub (#33997) [pick 9bdce76]
- fix(apps): let app turns follow the Auto approval mode (#38830) [pick e8336df]
- fix: end a dashboard turn stopped while it is still being prepared (#36478) [pick 37fff93]
- fix(acp): cleanup_session deletes the record on the session's own host (#39046) [pick 31b5ec4]
- fix(acp): scan only the new part of a streamed tool result (#38852) [pick e2870db]
- fix(sandbox): make an unscoped session host the OOM victim, not the gateway (#39189) [pick 2be6dde]
- fix(security): read aws s3 downloads piped into tail, with 2>&1, or with an AWS_PROFILE prefix (#38271) [pick bf65d97]
- fix: redact four display and log paths and use a fixed 502 message for session switch refusals (#38982) [pick 55d9ec7]
- fix(sandbox): pin a credential-masking app's folder after the masks on the namespace backend (#34339) [pick afd2b14]
- fix(acp): wait for systemd scope admission as its own startup stage (#37008) [pick 3e29c86]
- fix(acp): wait for systemd scope admission on the AcpClient spawn path (#38303) [pick 85f0a25]
- fix(acp): stamp the spawn instance on the AcpClient child (#38810) [pick f36eb5a]
- fix: end the turn when the agent never confirms a stop (#38512) [pick 2665c9d]
- fix(kas): renew a refused crew sign-in instead of failing every start (#38978) [pick 2f48cac]
- fix(security): keep self-host detection when the ssh verb is a glob (#34056) [pick ab53f10]
- fix(security): judge each substitution body for ssh-to-self (#37616) [pick d5b7ac3]
- test: check the ssh floor's nesting bound below the gate's depth cap (#37964) [pick 6c9ae1d]
- fix(mate): apply held Bot limits on shared claude sessions and refuse unnarrowed KAS children (#39212) [pick 721bbbe]
- test(integration): wait out and reset the hidden-chat refresh between boots (#37933) [pick e77586d]
- fix(browser): fall back to Kiro's Chromium under Automatic when Chrome's remote debugging is off (#39265) [pick 31912eb]

Left out of #39342's set (not needed for 0.13.0): the provider_labels
refactor, #34045, #36668, #39120 and #37627.

Merge with release/0.13.0: kept both imports in runtime_session_load,
runtime_spawn_launch and session_provider; session_allocation lists the
memory_policy owner; the keep-record resume path passes kas_memory_mode
as main does; dropped the ACP_BACKENDS_SESSION_EVICTION import that
moved to session_provider_new_conversation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiMo Code answers from Xiaomi's hosted model with no sign-in

2 participants