Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

MiMo thinks only at high effort

justrach322f8c0f8e94
diff --git a/docs/adr/0235-mimo-thinks-only-at-high-effort.md b/docs/adr/0235-mimo-thinks-only-at-high-effort.md
new file mode 100644
index 00000000..4d172922
--- /dev/null
+++ b/docs/adr/0235-mimo-thinks-only-at-high-effort.md
@@ -0,0 +1,39 @@
+# 0235. MiMo thinks only at high effort
+
+Status: accepted 2026-10-02
+
+## Context
+
+ADR 0192 made MiMo's thinking a binary switch and kept every positive effort
+as On. graff's default effort is medium, so every MiMo request went out with
+thinking enabled.
+
+Thinking dominated MiMo's wall time. One reply to a one-word prompt took
+several seconds with thinking enabled and under two without it. On tasks that
+read an MCP server, each call thought at length before acting, and a single
+call could think for minutes. Runs that did the same work with thinking off
+finished in a fraction of the time and passed at least as often. Thinking off
+did take more calls, but each was short. Turning thinking on only for a
+turn's first request, or leaving the field to the model's own default (which
+thinks), stayed slow.
+
+## Decision
+
+On the MiMo routes (direct Xiaomi and the Codegraff gateway), only `high` and
+above turn thinking on. `minimal`, `low` and `medium`, which includes graff's
+default, mean Off: Chat requests send `thinking.type=disabled`, and Responses
+requests send `reasoning.effort=none`. The picker still offers Off and On, and
+the status line and ACP report the default as Off. `/effort high` (On), a
+worker's effort pin, and a Jev choice of `high` still turn thinking on.
+
+This replaces ADR 0192's "existing positive values still mean On" for the
+levels below high.
+
+## Consequences
+
+MiMo no longer reasons by default, so a hard problem gets the model's direct
+answer unless someone picks On or Jev raises the effort. A saved `low` or
+`medium` from another model now means Off when the session moves to MiMo.
+
+Revisit if MiMo's thinking becomes bounded by effort, or if traces show
+default-effort MiMo runs failing where thinking would have passed.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index c6f9d084..6ac3b310 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -257,6 +257,7 @@ record only when you need the evidence or the edge cases.
| [0228](0228-read-only-child-calls-declared-read-only-mcp-tools.md) | An MCP tool is a read when its server declares `readOnlyHint: true` (`mcp.Tool.read_only`). A read-only (informational) child may call those and inherits only those from its root; undeclared MCP tools stay refused. |
| [0229](0229-every-chatgpt-login-is-chatgpt-new.md) | The Codex client's login no longer works, so every ChatGPT login name (`chatgpt`, `codex`, `openai`, `gpt`, `oai`) and the model picker run the `chatgpt-new` sign-in, and `chatgpt-new` precedes `codex` in the provider table. The `codex` provider stays for an existing Codex CLI `auth.json`. Replaces ADR 0221's "Codex first". |
| [0231](0231-no-round-trip-the-model-does-not-need.md) | No call the task did not ask for: a named small MCP server (and subagents, when asked for) loads with the first request, with the slim-shape note; `write_file` refuses to replace an unread file unless `replace: true` and reports created/replaced and JSON validity; inherited child MCP tools are never deferred; a piped bracketed paste is one prompt; unwatched (`-p`, piped) sessions get no `ask_user` and no low-effort reasoning summaries. |
+| [0235](0235-mimo-thinks-only-at-high-effort.md) | MiMo thinks only at `high` and above: `minimal`/`low`/`medium` (graff's default) send thinking Off on the Chat and Responses wires; On, a worker pin, or Jev's `high` turn it on. Replaces ADR 0192's "positive values mean On" below high. |
## When to write one
diff --git a/scripts/test-model-preference.py b/scripts/test-model-preference.py
index 8729a41f..1ad01e60 100644
--- a/scripts/test-model-preference.py
+++ b/scripts/test-model-preference.py
@@ -123,7 +123,7 @@ def main() -> None:
# across providers until the workspace explicitly allowlists it.
with launch(str(cwd), env, codex_home=None) as session:
session.wait_for_literal("Cross-provider use is blocked")
- session.wait_for_literal("mimo-v2.6-pro · High · ~/repo · Fallback")
+ session.wait_for_literal("mimo-v2.6-pro · Off · ~/repo · Fallback")
session.wait_for_prompt()
cursor = len(session.raw)
session.send_line("must not reach a provider")
@@ -137,7 +137,7 @@ def main() -> None:
# With explicit consent persisted, the same fallback is ready for use.
with launch(str(cwd), env, codex_home=None) as session:
session.wait_for_literal("saved preference kept")
- session.wait_for_literal("mimo-v2.6-pro · High · ~/repo · Fallback")
+ session.wait_for_literal("mimo-v2.6-pro · Off · ~/repo · Fallback")
session.wait_for_prompt()
clean_exit(session)
diff --git a/src/acp_config.zig b/src/acp_config.zig
index cf34a4bb..68091605 100644
--- a/src/acp_config.zig
+++ b/src/acp_config.zig
@@ -64,7 +64,7 @@ test "thought-level options follow the active model allowlist and normalized cur
try std.testing.expect((try option(&live, arena)) == null);
}
-test "MiMo thought-level discovery names Off and On and normalizes saved positive levels" {
+test "MiMo thought-level discovery names Off and On; levels below high are Off (ADR 0235)" {
var state = std.heap.ArenaAllocator.init(std.testing.allocator);
defer state.deinit();
const arena = state.allocator();
@@ -76,7 +76,9 @@ test "MiMo thought-level discovery names Off and On and normalizes saved positiv
try std.testing.expect(root.jev_effort_pending.commit(root.io, pending, .none));
try std.testing.expect(@import("jev_effort_state.zig").applyToState(&root));
try std.testing.expectEqualStrings("none", (try option(&live, arena)).?.currentValue);
- root.reasoning = .low;
+ root.reasoning = .medium; // graff's default
+ try std.testing.expectEqualStrings("none", (try option(&live, arena)).?.currentValue);
+ root.reasoning = .high;
const on = (try option(&live, arena)).?;
try std.testing.expectEqualStrings("high", on.currentValue);
try std.testing.expectEqual(@as(usize, 2), on.options.len);
diff --git a/src/effort_route.zig b/src/effort_route.zig
index 07466947..d1525ade 100644
--- a/src/effort_route.zig
+++ b/src/effort_route.zig
@@ -66,6 +66,8 @@ pub fn grokFamily(model: []const u8) bool {
/// MiMo's current APIs expose thinking as a binary switch. Gateway catalog
/// rows may include a family prefix; inspect the final model component.
+/// ADR 0235: the switch is On only at high and above. graff's default
+/// (medium) leaves it Off: MiMo thinks at length on every call when it is on.
pub fn mimoFamily(model: []const u8) bool {
const name = if (std.mem.lastIndexOfScalar(u8, model, '/')) |slash| model[slash + 1 ..] else model;
return std.ascii.startsWithIgnoreCase(name, "mimo-");
@@ -98,8 +100,9 @@ pub fn levels(provider_id: []const u8, model: []const u8) []const []const u8 {
/// Ultra keeps its existing wire mapping to `max` and delegation guidance.
pub fn normalize(provider_id: []const u8, model: []const u8, requested: []const u8) []const u8 {
if (mimoRoute(provider_id, model)) {
- if (std.mem.eql(u8, requested, "none") or std.mem.eql(u8, requested, "off")) return "none";
- for ([_][]const u8{ "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "on" }) |positive|
+ for ([_][]const u8{ "none", "off", "minimal", "low", "medium" }) |below|
+ if (std.mem.eql(u8, requested, below)) return "none";
+ for ([_][]const u8{ "high", "xhigh", "max", "ultra", "on" }) |positive|
if (std.mem.eql(u8, requested, positive)) return "high";
return requested;
}
@@ -142,7 +145,7 @@ pub fn allows(provider_id: []const u8, model: []const u8, tag: []const u8) bool
/// default `medium` becomes `low`. grok maps max/ultra → high (xAI rejects
/// `max`). Other seats still send ultra as `max` (including OpenAI).
pub fn wireEffort(provider_id: []const u8, model: []const u8, requested: []const u8) []const u8 {
- if (mimoRoute(provider_id, model)) return if (std.mem.eql(u8, requested, "none")) "none" else "high";
+ if (mimoRoute(provider_id, model)) return normalize(provider_id, model, requested);
if (std.mem.eql(u8, requested, "medium")) if (codexCatalog(provider_id, model)) |info| if (info.default_effort) |d| return d;
if (std.mem.eql(u8, requested, "medium") and omitsDefaultFlashEffort(model)) return "low";
if (grokFamily(model)) {
@@ -221,7 +224,7 @@ test "GPT-5.6 family: max is accepted (as Ultra) and wired as max; grok still fo
try std.testing.expect(!allows("xai", "grok-4.6", "ultra"));
}
-test "MiMo exposes only Off and On while legacy positive settings remain On" {
+test "ADR 0235: MiMo exposes Off and On, and thinks only at high and above" {
for ([_][]const u8{ "mimo-v2.6-flash", "MiMo-V2.6-Pro", "xiaomi/mimo-v2.6-pro" }) |model| {
try std.testing.expect(mimoFamily(model));
const offered = levels("codegraff", model);
@@ -230,9 +233,13 @@ test "MiMo exposes only Off and On while legacy positive settings remain On" {
try std.testing.expectEqualStrings("high", offered[1]);
try std.testing.expectEqualStrings("none", normalize("xiaomi", model, "off"));
try std.testing.expectEqualStrings("none", wireEffort("codegraff", model, "none"));
- for ([_][]const u8{ "low", "medium", "high", "xhigh", "max", "ultra" }) |legacy| {
- try std.testing.expectEqualStrings("high", normalize("xiaomi", model, legacy));
- try std.testing.expectEqualStrings("high", wireEffort("codegraff", model, legacy));
+ for ([_][]const u8{ "minimal", "low", "medium" }) |below| { // medium is graff's default
+ try std.testing.expectEqualStrings("none", normalize("xiaomi", model, below));
+ try std.testing.expectEqualStrings("none", wireEffort("codegraff", model, below));
+ }
+ for ([_][]const u8{ "high", "xhigh", "max", "ultra", "on" }) |positive| {
+ try std.testing.expectEqualStrings("high", normalize("xiaomi", model, positive));
+ try std.testing.expectEqualStrings("high", wireEffort("codegraff", model, positive));
}
}
try std.testing.expectEqualStrings("", normalize("openai", "gpt-6-astra", "none"));
diff --git a/src/mimo_effort_tests.zig b/src/mimo_effort_tests.zig
index 8264ab11..3884ac83 100644
--- a/src/mimo_effort_tests.zig
+++ b/src/mimo_effort_tests.zig
@@ -27,7 +27,11 @@ test "MiMo Chat uses the documented binary thinking switch on direct and gateway
defer std.testing.allocator.free(off);
try std.testing.expect(std.mem.indexOf(u8, off, "\"thinking\":{\"type\":\"disabled\"}") != null);
try std.testing.expect(std.mem.indexOf(u8, off, "reasoning_effort") == null);
- agent.reasoning = .low; // a saved positive level still means On
+ agent.reasoning = .medium; // ADR 0235: the default leaves thinking off
+ const default = try agent.buildBody(null, false, true, true);
+ defer std.testing.allocator.free(default);
+ try std.testing.expect(std.mem.indexOf(u8, default, "\"thinking\":{\"type\":\"disabled\"}") != null);
+ agent.reasoning = .high; // On
const on = try agent.buildBody(null, false, true, true);
defer std.testing.allocator.free(on);
try std.testing.expect(std.mem.indexOf(u8, on, "\"thinking\":{\"type\":\"enabled\"}") != null);
@@ -45,7 +49,11 @@ test "MiMo Responses sends none or high, including internal summaries" {
defer std.testing.allocator.free(off);
try std.testing.expect(std.mem.indexOf(u8, off, "\"reasoning\":{\"effort\":\"none\"}") != null);
agent.compaction_request = false;
- agent.reasoning = .medium;
+ agent.reasoning = .medium; // ADR 0235: the default is Off
+ const default = try agent.buildBody(null, false, true, true);
+ defer std.testing.allocator.free(default);
+ try std.testing.expect(std.mem.indexOf(u8, default, "\"reasoning\":{\"effort\":\"none\"}") != null);
+ agent.reasoning = .high;
const on = try agent.buildBody(null, false, true, true);
defer std.testing.allocator.free(on);
try std.testing.expect(std.mem.indexOf(u8, on, "\"reasoning\":{\"effort\":\"high\"}") != null);
diff --git a/src/spec_prompt_cache_conformance.zig b/src/spec_prompt_cache_conformance.zig
index 676b7402..8c719895 100644
--- a/src/spec_prompt_cache_conformance.zig
+++ b/src/spec_prompt_cache_conformance.zig
@@ -171,7 +171,8 @@ test "prompt cache: effort is never auto-flipped (prefix stays)" {
defer std.testing.allocator.free(b1);
const b2 = try root.buildBody(null, false, true, true);
defer std.testing.allocator.free(b2);
- try std.testing.expect(std.mem.indexOf(u8, b1, "\"thinking\":{\"type\":\"enabled\"}") != null);
- try std.testing.expect(std.mem.indexOf(u8, b2, "\"thinking\":{\"type\":\"enabled\"}") != null);
+ // The gateway default is MiMo, which thinks only at high and above (ADR 0235).
+ try std.testing.expect(std.mem.indexOf(u8, b1, "\"thinking\":{\"type\":\"disabled\"}") != null);
+ try std.testing.expect(std.mem.indexOf(u8, b2, "\"thinking\":{\"type\":\"disabled\"}") != null);
try std.testing.expectEqualStrings(cacheKeyIn(b1).?, cacheKeyIn(b2).?);
}