xonecas.io
64875
Mc

mini-coder / commit 210098a

feat: display effective thinking level

xonecas2026-09-25 210098aeaa940229aa7d25ed2749b236895d11f5 parent 348e0a9

4 files changed

src/agent.ts+3−3
@@ -4,8 +4,8 @@ import {
44 type JsonObject,
55 type Message,
66 type Model,
7+ type ModelThinkingLevel,
78 type Models,
8- type ThinkingLevel,
99 type Tool,
1010 type ToolCall,
1111 type ToolResultMessage,
@@ -48,7 +48,7 @@ export interface AgentOptions {
4848 systemPrompt: string;
4949 tools: Tool[];
5050 toolNames: ToolName[];
51- thinkingEffort: ThinkingLevel;
51+ thinkingEffort: ModelThinkingLevel;
5252 session: Session;
5353 }
5454
@@ -112,7 +112,7 @@ export async function runAgentTurn(run: AgentRun): Promise<void> {
112112 let stream;
113113 try {
114114 stream = run.models.streamSimple(run.model, context, {
115- reasoning: run.thinkingEffort,
115+ reasoning: run.thinkingEffort === "off" ? undefined : run.thinkingEffort,
116116 signal,
117117 sessionId: session.id ?? undefined,
118118 });
src/cli.ts+2−2
@@ -1,5 +1,5 @@
11 import process from "node:process";
2-import type { AssistantMessage, Message, UserMessage } from "@earendil-works/pi-ai";
2+import { clampThinkingLevel, type AssistantMessage, type Message, type UserMessage } from "@earendil-works/pi-ai";
33 import { loadConfig, resolveModel } from "./config.ts";
44 import { buildSystemPrompt } from "./prompt.ts";
55 import { acceptsImages, toolSchemas } from "./tools/index.ts";
@@ -88,7 +88,7 @@ async function main(): Promise<void> {
8888 systemPrompt: buildSystemPrompt(config),
8989 tools: toolSchemas(config.tools, acceptsImages(model)),
9090 toolNames: config.tools,
91- thinkingEffort: config.thinkingEffort,
91+ thinkingEffort: clampThinkingLevel(model, config.thinkingEffort),
9292 session,
9393 };
9494
src/tui/tui.ts+1−1
@@ -221,7 +221,7 @@ class Tui {
221221 process.on("SIGINT", this.onSignal);
222222 process.on("SIGTERM", this.onSignal);
223223 this.separator = true;
224- this.push(`mini-coder · ${this.opts.model.provider}/${this.opts.model.id}`);
224+ this.push(`mini-coder · ${this.opts.model.provider}/${this.opts.model.id} · ${this.opts.thinkingEffort}`);
225225 this.separator = true;
226226 this.render();
227227 }
ux-walk.md+10−6
@@ -124,7 +124,7 @@ runs the TypeScript entrypoint directly.
124124 background=#ffffff foreground=#000000 cursor=#000000`; the app paints its own
125125 palette, so the light-theme check is that no row leaks the host's colours.
126126 - Use the provider and model already configured in `~/.config/mini-coder`
127- (`opencode-go/deepseek-v4.1-flash`, default effort `medium`), with short
127+ (`opencode-go/deepseek-v4.1-flash`, effective effort `high`), with short
128128 single-purpose prompts — one prompt per state you want to reach — so streaming,
129129 reasoning, tool calls, and usage numbers are all genuine. Reach the hostile
130130 shapes through the model too: ask it to run a command that prints a few hundred
@@ -134,9 +134,12 @@ runs the TypeScript entrypoint directly.
134134 reported as not covered rather than faked: the `read` of an image on a model
135135 that does *not* accept image input (this model declares image input, so the
136136 other case needs a different provider/model), and a provider error or stalled
137- stream. Note also that `thinkingLevelMap.medium` is `null`, so the request
138- carries no thinking level and the dimmed reasoning preview appears only for
139- prompts that make the model think.
137+ stream. Note also that the config default effort is `medium`, but this model's
138+ `thinkingLevelMap` marks `minimal`, `medium`, and `xhigh` as `null` — only
139+ `low`, `high`, and `max` are supported — so the app clamps the default up to
140+ `high`: the request carries `reasoning_effort: "high"` and the startup banner
141+ reads `... · high`. The dimmed reasoning preview appears only for prompts that
142+ make the model think.
140143 - Hazard: with a live turn, the model's own `bash` tool can reach this pane
141144 (`kitty @ --to unix:/tmp/uxw-<date> send-key ...`), so prompts must be
142145 self-contained, and the pane must be re-read rather than assumed to hold still.
@@ -148,8 +151,9 @@ done until every one of these has been reached and captured:
148151
149152 Startup and idle
150153
151-- banner `mini-coder · <provider>/<model>`, empty scrollback, status row showing
152- only the context readout, cursor at column 0 of the editor.
154+- banner `mini-coder · <provider>/<model> · <effective thinking effort>`, empty
155+ scrollback, status row showing only the context readout, cursor at column 0 of
156+ the editor.
153157 - editor: empty draft, one line wrapping past the width, more lines than the
154158 viewport, caret at each wrap boundary (read it with `--add-cursor`), Home/End,
155159 Ctrl+A/Ctrl+E, Ctrl+Home/Ctrl+End, word motions, backspace/delete across a line