xonecas.io
64875
Mc

mini-coder / commit d9f67cf

feat: TAB completions, /new reset, banner context, max-context UX, cleanup

- Extract completions into src/cli/completions.ts with command, skill, and file path completion
- /new clears terminal and reprints banner
- Banner shows discovered context files, agents, skills, custom commands
- Detect context-length API errors with user-friendly message
- Remove dead code: unused ANSI constants, _hasTools, _toolCallId params
- Remove overly broad max_tokens error match (false positive risk)
- Fix duplicate comment in commands.ts, duplicate line in man page
- Update skills.md: name/description are optional with defaults
- Add /review to man page
- Remove completed items from TODO.md

xonecas2026-03-14 d9f67cfd21685aeb40a9673879b25474c186c4e9 parent 77efd34

15 files changed

TODO.md+1−2
@@ -1,11 +1,10 @@
11 # TODO
22
3-- Improve our autocomplete via TAB. it should work on all commands and parameters. When the user uses tab assume it's a file path autocompletion.
43 - Tool hooks output prints inline with spinner
5-- When the user uses /new reset the terminal and clear the history, print the banner again
64 - Review our markdown renderer. Let's make it render the raw markdown, but syntax highlited
75 - add a spinner state showing the user when the undo snapshotting is happening
86 - Structuted output when a skill is auto loaded for the agent
7+
98 - Kimi-k2.5 and other models that use the same sdk hang for long periods during turns.
109 - Kimi-k2.5, GLM-5 and other models that use the same sdk produce these errors:
1110
docs/mini-coder.1.md+6−1
@@ -82,6 +82,10 @@ Inside the interactive session, the following slash commands are available:
8282 **/agent [name]**
8383 : Set or clear an active primary custom agent.
8484
85+**/review**
86+: Custom command that reviews the current session's changes (defined via `.agents/commands/`).
87+
88+
8589 **/help**
8690 : Display command help.
8791
@@ -146,4 +150,5 @@ The agent has access to the following tools:
146150 * **Model Context Protocol (MCP)**: Native support for connecting external tools via MCP servers over HTTP or stdio.
147151 * **Prompt Caching**: Configurable caching behaviors for supported providers (OpenAI, Gemini).
148152 * **Undo Functionality**: Roll back the last conversation turn, cleanly restoring previous file states and git history via snapshots.
149-ack the last conversation turn, cleanly restoring previous file states and git history via snapshots.
153+
154+
docs/skills.md+7−6
@@ -28,19 +28,20 @@ If multiple skills share the same `name`, precedence is deterministic:
2828 2. Any local skill wins over global.
2929 3. At the same scope/path level, `.agents` wins over `.claude`.
3030
31-## Frontmatter validation
31+## Frontmatter
3232
33-`SKILL.md` frontmatter must include:
33+`SKILL.md` frontmatter supports:
3434
35-- `name` (required)
36-- `description` (required)
35+- `name` (optional — defaults to the folder name)
36+- `description` (optional — defaults to `"(no description)"`)
3737
38-`name` constraints:
38+`name` constraints (when provided):
3939
4040 - lowercase alphanumeric and hyphen format (`^[a-z0-9]+(?:-[a-z0-9]+)*$`)
4141 - 1–64 characters
4242
43-Invalid skills are skipped with warnings. Unknown frontmatter fields are allowed.
43+Unknown frontmatter fields are allowed.
44+
4445
4546 ## Create a skill
4647
src/cli/commands.ts+5−5
@@ -15,7 +15,7 @@ import {
1515 } from "./custom-commands.ts";
1616 import { watchForCancel } from "./input.ts";
1717 import { renderMarkdown } from "./markdown.ts";
18-import { PREFIX, write, writeln } from "./output.ts";
18+import { PREFIX, renderBanner, write, writeln } from "./output.ts";
1919
2020 import { loadSkillsIndex } from "./skills.ts";
2121
@@ -425,9 +425,9 @@ async function handleMcp(ctx: CommandContext, args: string): Promise<void> {
425425
426426 function handleNew(ctx: CommandContext): void {
427427 ctx.startNewSession();
428- writeln(
429- `${PREFIX.success} ${c.dim("new session started — context cleared")}`,
430- );
428+ // Clear terminal and reprint banner for a fresh session feel
429+ process.stdout.write("\x1b[2J\x1b[H");
430+ renderBanner(ctx.currentModel, ctx.cwd);
431431 }
432432
433433 // ─── Custom commands ──────────────────────────────────────────────────────────
@@ -448,7 +448,7 @@ async function handleCustomCommand(
448448 writeln();
449449
450450 // context: fork (Claude Code) or subtask: true (OpenCode) → isolated subagent.
451- // context: fork (Claude Code) or subtask: true (OpenCode) → isolated subagent.
451+
452452 // Default: run inline in the current conversation.
453453 const fork = cmd.context === "fork" || cmd.subtask === true;
454454
src/cli/completions.test.ts+92−0
@@ -0,0 +1,92 @@
1+import { describe, expect, test } from "bun:test";
2+import { getCommandCompletions } from "./completions.ts";
3+
4+describe("getCommandCompletions", () => {
5+ const cwd = process.cwd();
6+
7+ test("completes partial command name", () => {
8+ const results = getCommandCompletions("/mod", cwd);
9+ expect(results).toContain("/model");
10+ expect(results).toContain("/models");
11+ });
12+
13+ test("completes /m to multiple commands", () => {
14+ const results = getCommandCompletions("/m", cwd);
15+ expect(results).toContain("/model");
16+ expect(results).toContain("/models");
17+ expect(results).toContain("/mcp");
18+ });
19+
20+ test("returns empty for unknown command prefix", () => {
21+ const results = getCommandCompletions("/zzz", cwd);
22+ expect(results).toEqual([]);
23+ });
24+
25+ test("completes /model subcommand", () => {
26+ const results = getCommandCompletions("/model ", cwd);
27+ expect(results).toContain("/model effort");
28+ });
29+
30+ test("completes /model effort values", () => {
31+ const results = getCommandCompletions("/model effort l", cwd);
32+ expect(results).toContain("/model effort low");
33+ });
34+
35+ test("completes /reasoning params", () => {
36+ const results = getCommandCompletions("/reasoning o", cwd);
37+ expect(results).toContain("/reasoning on");
38+ expect(results).toContain("/reasoning off");
39+ });
40+
41+ test("completes /context subcommands", () => {
42+ const results = getCommandCompletions("/context p", cwd);
43+ expect(results).toContain("/context prune");
44+ });
45+
46+ test("completes /context prune values", () => {
47+ const results = getCommandCompletions("/context prune b", cwd);
48+ expect(results).toContain("/context prune balanced");
49+ });
50+
51+ test("completes /cache subcommands", () => {
52+ const results = getCommandCompletions("/cache o", cwd);
53+ expect(results).toContain("/cache on");
54+ expect(results).toContain("/cache off");
55+ expect(results).toContain("/cache openai");
56+ });
57+
58+ test("completes /cache openai values", () => {
59+ const results = getCommandCompletions("/cache openai i", cwd);
60+ expect(results).toContain("/cache openai in_memory");
61+ });
62+
63+ test("completes /mcp subcommands", () => {
64+ const results = getCommandCompletions("/mcp ", cwd);
65+ expect(results).toContain("/mcp list");
66+ expect(results).toContain("/mcp add");
67+ expect(results).toContain("/mcp remove");
68+ expect(results).toContain("/mcp rm");
69+ });
70+
71+ test("completes /agent with off", () => {
72+ const results = getCommandCompletions("/agent o", cwd);
73+ expect(results).toContain("/agent off");
74+ });
75+
76+ test("exact match for single-word command", () => {
77+ const results = getCommandCompletions("/undo", cwd);
78+ expect(results).toEqual(["/undo"]);
79+ });
80+
81+ test("/ alone lists all commands", () => {
82+ const results = getCommandCompletions("/", cwd);
83+ expect(results.length).toBeGreaterThan(5);
84+ expect(results).toContain("/model");
85+ expect(results).toContain("/help");
86+ });
87+
88+ test("returns empty for fourth token", () => {
89+ const results = getCommandCompletions("/cache openai in_memory extra", cwd);
90+ expect(results).toEqual([]);
91+ });
92+});
src/cli/completions.ts+151−0
@@ -0,0 +1,151 @@
1+import { join, relative } from "node:path";
2+import { loadAgents } from "./agents.ts";
3+import { loadCustomCommands } from "./custom-commands.ts";
4+import { loadSkillsIndex } from "./skills.ts";
5+
6+// ─── Built-in commands ─────────────────────────────────────────────────────────
7+
8+const BUILTIN_COMMANDS = [
9+ "model",
10+ "models",
11+ "undo",
12+ "reasoning",
13+ "context",
14+ "cache",
15+ "agent",
16+ "mcp",
17+ "new",
18+ "help",
19+ "exit",
20+ "quit",
21+];
22+
23+// ─── Sub-command / parameter completions ───────────────────────────────────────
24+
25+const COMMAND_PARAMS: Record<string, string[] | ((cwd: string) => string[])> = {
26+ model: ["effort"],
27+ reasoning: ["on", "off"],
28+ context: ["prune", "cap"],
29+ cache: ["on", "off", "openai", "gemini"],
30+ mcp: ["list", "add", "remove", "rm"],
31+ agent: (cwd) => {
32+ const agents = loadAgents(cwd);
33+ return ["off", ...agents.keys()];
34+ },
35+};
36+
37+const NESTED_PARAMS: Record<string, Record<string, string[]>> = {
38+ model: { effort: ["low", "medium", "high", "xhigh", "off"] },
39+ context: {
40+ prune: ["off", "balanced", "aggressive"],
41+ cap: ["off"],
42+ },
43+ cache: {
44+ openai: ["in_memory", "24h"],
45+ gemini: ["off"],
46+ },
47+};
48+
49+// ─── Public API ────────────────────────────────────────────────────────────────
50+
51+const MAX = 10;
52+
53+/** Complete a `/`-prefixed command input. `text` includes the leading `/`. */
54+export function getCommandCompletions(text: string, cwd: string): string[] {
55+ const parts = text.slice(1).split(/\s+/);
56+ const p0 = (parts[0] ?? "").toLowerCase();
57+
58+ // Completing the command name itself: `/mod` → `/model`
59+ if (parts.length === 1) {
60+ const results: string[] = [];
61+
62+ // Built-in commands
63+ for (const cmd of BUILTIN_COMMANDS) {
64+ if (cmd.startsWith(p0)) results.push(`/${cmd}`);
65+ if (results.length >= MAX) break;
66+ }
67+
68+ // Custom commands
69+ if (results.length < MAX) {
70+ const custom = loadCustomCommands(cwd);
71+ for (const name of custom.keys()) {
72+ if (name.startsWith(p0)) results.push(`/${name}`);
73+ if (results.length >= MAX) break;
74+ }
75+ }
76+
77+ return results;
78+ }
79+
80+ // Completing second token: `/model eff` → `/model effort`
81+ if (parts.length === 2) {
82+ const query = (parts[1] ?? "").toLowerCase();
83+ const paramDef = COMMAND_PARAMS[p0];
84+ if (!paramDef) return [];
85+ const options = typeof paramDef === "function" ? paramDef(cwd) : paramDef;
86+ return options
87+ .filter((o) => o.startsWith(query))
88+ .slice(0, MAX)
89+ .map((o) => `/${p0} ${o}`);
90+ }
91+
92+ // Completing third token: `/model effort lo` → `/model effort low`
93+ if (parts.length === 3) {
94+ const sub = (parts[1] ?? "").toLowerCase();
95+ const query = (parts[2] ?? "").toLowerCase();
96+ const nested = NESTED_PARAMS[p0]?.[sub];
97+ if (!nested) return [];
98+ return nested
99+ .filter((o) => o.startsWith(query))
100+ .slice(0, MAX)
101+ .map((o) => `/${p0} ${sub} ${o}`);
102+ }
103+
104+ return [];
105+}
106+
107+/** Complete an `@`-prefixed reference (skills, files). */
108+
109+export async function getAtCompletions(
110+ prefix: string,
111+ cwd: string,
112+): Promise<string[]> {
113+ const query = prefix.startsWith("@") ? prefix.slice(1) : prefix;
114+ const results: string[] = [];
115+
116+ // Skills: @<skill-name>
117+ const skills = loadSkillsIndex(cwd);
118+ for (const [name] of skills) {
119+ if (results.length >= MAX) break;
120+ if (name.includes(query)) results.push(`@${name}`);
121+ }
122+
123+ // Files: @<relative-path> — fill remaining slots up to MAX
124+
125+ if (results.length < MAX) {
126+ const glob = new Bun.Glob(`**/*${query}*`);
127+ for await (const file of glob.scan({ cwd, onlyFiles: true })) {
128+ if (file.includes("node_modules") || file.includes(".git")) continue;
129+ results.push(`@${relative(cwd, join(cwd, file))}`);
130+ if (results.length >= MAX) break;
131+ }
132+ }
133+
134+ return results;
135+}
136+
137+/** Complete a bare file path (no `@` prefix). */
138+export async function getFilePathCompletions(
139+ query: string,
140+ cwd: string,
141+): Promise<string[]> {
142+ if (!query) return [];
143+ const results: string[] = [];
144+ const glob = new Bun.Glob(`${query}*`);
145+ for await (const file of glob.scan({ cwd })) {
146+ if (file.includes("node_modules") || file.includes(".git")) continue;
147+ results.push(file);
148+ if (results.length >= MAX) break;
149+ }
150+ return results;
151+}
src/cli/error-parse.test.ts+27−0
@@ -25,6 +25,33 @@ test("parseAppError - APICallError 429", () => {
2525 });
2626 });
2727
28+test("parseAppError - APICallError context_length_exceeded", () => {
29+ const err = new APICallError({
30+ message:
31+ "This model's maximum context length is 128000 tokens. context_length_exceeded",
32+ statusCode: 400,
33+ url: "https://api.example.com",
34+ requestBodyValues: {},
35+ });
36+ expect(parseAppError(err)).toEqual({
37+ headline: "Max context size reached",
38+ hint: "Use /context prune to reduce history, or /new to start fresh",
39+ });
40+});
41+
42+test("parseAppError - APICallError request too large", () => {
43+ const err = new APICallError({
44+ message: "Request too large for model",
45+ statusCode: 400,
46+ url: "https://api.example.com",
47+ requestBodyValues: {},
48+ });
49+ expect(parseAppError(err)).toEqual({
50+ headline: "Max context size reached",
51+ hint: "Use /context prune to reduce history, or /new to start fresh",
52+ });
53+});
54+
2855 test("parseAppError - APICallError 401", () => {
2956 const err = new APICallError({
3057 message: "Unauthorized",
src/cli/error-parse.ts+12−0
@@ -23,6 +23,18 @@ export function parseAppError(err: unknown): {
2323 }
2424
2525 if (err instanceof APICallError) {
26+ const body = String(err.message).toLowerCase();
27+ if (
28+ body.includes("context_length_exceeded") ||
29+ body.includes("maximum context length") ||
30+ body.includes("too many tokens") ||
31+ body.includes("request too large")
32+ ) {
33+ return {
34+ headline: "Max context size reached",
35+ hint: "Use /context prune to reduce history, or /new to start fresh",
36+ };
37+ }
2638 if (err.statusCode === 429) {
2739 return {
2840 headline: "Rate limit hit",
src/cli/input.ts+41−48
@@ -1,12 +1,17 @@
1-import { join, relative } from "node:path";
1+import { join } from "node:path";
22 import * as c from "yoctocolors";
3+
34 import { addPromptHistory, getPromptHistory } from "../session/db/index.ts";
5+import {
6+ getAtCompletions,
7+ getCommandCompletions,
8+ getFilePathCompletions,
9+} from "./completions.ts";
410 import {
511 type ImageAttachment,
612 isImageFilename,
713 loadImageFile,
814 } from "./image-types.ts";
9-import { loadSkillsIndex } from "./skills.ts";
1015 import { terminal } from "./terminal-io.ts";
1116
1217 // ─── ANSI escape sequences ────────────────────────────────────────────────────
@@ -14,12 +19,6 @@ import { terminal } from "./terminal-io.ts";
1419 const ESC = "\x1B";
1520 const CSI = `${ESC}[`;
1621 const CLEAR_LINE = `\r${CSI}2K`;
17-const _CURSOR_LEFT = `${CSI}D`;
18-const _CURSOR_RIGHT = `${CSI}C`;
19-const _CURSOR_UP = `${CSI}A`;
20-const _CURSOR_DOWN = `${CSI}B`;
21-const _SAVE_CURSOR = `${CSI}s`;
22-const _RESTORE_CURSOR = `${CSI}u`;
2322 const BPASTE_ENABLE = `${ESC}[?2004h`;
2423 const BPASTE_DISABLE = `${ESC}[?2004l`;
2524 const BPASTE_START = `${ESC}[200~`;
@@ -54,36 +53,6 @@ export type InputResult =
5453 | { type: "command"; command: string; args: string }
5554 | { type: "shell"; command: string };
5655
57-// ─── File autocomplete ────────────────────────────────────────────────────────
58-
59-async function getAtCompletions(
60- prefix: string,
61- cwd: string,
62-): Promise<string[]> {
63- const query = prefix.startsWith("@") ? prefix.slice(1) : prefix;
64- const results: string[] = [];
65- const MAX = 10;
66-
67- // Skills: @<skill-name>
68- const skills = loadSkillsIndex(cwd);
69- for (const [name] of skills) {
70- if (results.length >= MAX) break;
71- if (name.includes(query)) results.push(`@${name}`);
72- }
73-
74- // Files: @<relative-path> — fill remaining slots up to MAX
75- if (results.length < MAX) {
76- const glob = new Bun.Glob(`**/*${query}*`);
77- for await (const file of glob.scan({ cwd, onlyFiles: true })) {
78- if (file.includes("node_modules") || file.includes(".git")) continue;
79- results.push(`@${relative(cwd, join(cwd, file))}`);
80- if (results.length >= MAX) break;
81- }
82- }
83-
84- return results;
85-}
86-
8756 // ─── Image detection ─────────────────────────────────────────────────────────
8857
8958 /**
@@ -655,24 +624,48 @@ export async function readline(opts: { cwd?: string }): Promise<InputResult> {
655624 }
656625
657626 if (raw === TAB) {
658- // File autocomplete for @-prefixed words
659627 const beforeCursor = buf.slice(0, cursor);
660- const atMatch = beforeCursor.match(/@(\S*)$/);
661- if (atMatch) {
662- const completions = await getAtCompletions(atMatch[0], cwd);
628+
629+ // Apply a single completion or show multiple options
630+ const applyCompletions = (
631+ completions: string[],
632+ replaceFrom: number,
633+ ) => {
663634 if (completions.length === 1 && completions[0]) {
664635 const replacement = completions[0];
665- buf =
666- buf.slice(0, cursor - (atMatch[0] ?? "").length) +
667- replacement +
668- buf.slice(cursor);
669- cursor = cursor - (atMatch[0] ?? "").length + replacement.length;
636+ buf = buf.slice(0, replaceFrom) + replacement + buf.slice(cursor);
637+ cursor = replaceFrom + replacement.length;
670638 renderPrompt();
671639 } else if (completions.length > 1) {
672640 process.stdout.write("\n");
673- for (const c of completions) process.stdout.write(` ${c}\n`);
641+ for (const item of completions) process.stdout.write(` ${item}\n`);
674642 renderPrompt();
675643 }
644+ };
645+
646+ // 1) Command completion: `/...`
647+ if (beforeCursor.startsWith("/")) {
648+ const completions = getCommandCompletions(beforeCursor, cwd);
649+ applyCompletions(completions, 0);
650+ continue;
651+ }
652+
653+ // 2) @ reference completion: `@...`
654+ const atMatch = beforeCursor.match(/@(\S*)$/);
655+ if (atMatch) {
656+ const completions = await getAtCompletions(atMatch[0], cwd);
657+ applyCompletions(completions, cursor - (atMatch[0] ?? "").length);
658+ continue;
659+ }
660+
661+ // 3) Bare file path completion: complete the current word as a path
662+ const wordMatch = beforeCursor.match(/(\S+)$/);
663+ if (wordMatch) {
664+ const completions = await getFilePathCompletions(
665+ wordMatch[1] ?? "",
666+ cwd,
667+ );
668+ applyCompletions(completions, cursor - (wordMatch[1] ?? "").length);
676669 }
677670 continue;
678671 }
src/cli/output.ts+44−0
@@ -1,5 +1,10 @@
1+import { existsSync } from "node:fs";
12 import { homedir } from "node:os";
3+import { join } from "node:path";
24 import * as c from "yoctocolors";
5+import { loadAgents } from "./agents.ts";
6+import { loadCustomCommands } from "./custom-commands.ts";
7+import { loadSkillsIndex } from "./skills.ts";
38 import { terminal } from "./terminal-io.ts";
49
510 const HOME = homedir();
@@ -68,6 +73,23 @@ export const PREFIX = {
6873
6974 // ─── Banner ───────────────────────────────────────────────────────────────────
7075
76+/** Discover which context/config files exist for display in the banner. */
77+function discoverContextFiles(cwd: string): string[] {
78+ const found: string[] = [];
79+ const globalDir = join(HOME, ".agents");
80+ const candidates: [string, string][] = [
81+ [join(globalDir, "AGENTS.md"), "~/.agents/AGENTS.md"],
82+ [join(globalDir, "CLAUDE.md"), "~/.agents/CLAUDE.md"],
83+ [join(cwd, ".agents", "AGENTS.md"), ".agents/AGENTS.md"],
84+ [join(cwd, "CLAUDE.md"), "CLAUDE.md"],
85+ [join(cwd, "AGENTS.md"), "AGENTS.md"],
86+ ];
87+ for (const [abs, label] of candidates) {
88+ if (existsSync(abs)) found.push(label);
89+ }
90+ return found;
91+}
92+
7193 export function renderBanner(model: string, cwd: string): void {
7294 writeln();
7395 writeln(` ${c.cyan("mc")} ${c.dim(`mini-coder · v${PACKAGE_VERSION}`)}`);
@@ -75,6 +97,28 @@ export function renderBanner(model: string, cwd: string): void {
7597 writeln(
7698 ` ${c.dim("/help for commands · esc cancel · ctrl+c/ctrl+d exit")}`,
7799 );
100+
101+ // Show discovered configs and context
102+ const items: string[] = [];
103+ const contextFiles = discoverContextFiles(cwd);
104+ if (contextFiles.length > 0) items.push(...contextFiles);
105+
106+ const agents = loadAgents(cwd);
107+ if (agents.size > 0)
108+ items.push(`${agents.size} agent${agents.size > 1 ? "s" : ""}`);
109+
110+ const skills = loadSkillsIndex(cwd);
111+ if (skills.size > 0)
112+ items.push(`${skills.size} skill${skills.size > 1 ? "s" : ""}`);
113+
114+ const commands = loadCustomCommands(cwd);
115+ if (commands.size > 0)
116+ items.push(`${commands.size} custom cmd${commands.size > 1 ? "s" : ""}`);
117+
118+ if (items.length > 0) {
119+ writeln(` ${c.dim(items.join(" · "))}`);
120+ }
121+
78122 writeln();
79123 }
80124
src/cli/stream-render.ts+4−7
@@ -155,19 +155,16 @@ export async function renderTurn(
155155 case "tool-call-start": {
156156 flushAnyText();
157157 spinner.stop();
158- renderToolCall(event.toolName, event.args, event.toolCallId);
158+ renderToolCall(event.toolName, event.args);
159+
159160 spinner.start(event.toolName);
160161 break;
161162 }
162163
163164 case "tool-result": {
164165 spinner.stop();
165- renderToolResult(
166- event.toolName,
167- event.result,
168- event.isError,
169- event.toolCallId,
170- );
166+ renderToolResult(event.toolName, event.result, event.isError);
167+
171168 spinner.start("thinking");
172169 break;
173170 }
src/cli/tool-render.ts+3−12
@@ -14,11 +14,7 @@ function toolGlyph(name: string): string {
1414 return G.info;
1515 }
1616
17-function toolCallLine(
18- name: string,
19- args: unknown,
20- _toolCallId?: string,
21-): string {
17+function toolCallLine(name: string, args: unknown): string {
2218 const a =
2319 args && typeof args === "object" ? (args as Record<string, unknown>) : {};
2420
@@ -62,12 +58,8 @@ function toolCallLine(
6258 return `${toolGlyph(name)} ${c.dim(name)}`;
6359 }
6460
65-export function renderToolCall(
66- toolName: string,
67- args: unknown,
68- toolCallId?: string,
69-): void {
70- writeln(` ${toolCallLine(toolName, args, toolCallId)}`);
61+export function renderToolCall(toolName: string, args: unknown): void {
62+ writeln(` ${toolCallLine(toolName, args)}`);
7163 }
7264 export function renderHook(
7365 toolName: string,
@@ -129,7 +121,6 @@ export function renderToolResult(
129121 toolName: string,
130122 result: unknown,
131123 isError: boolean,
132- _toolCallId?: string,
133124 ): void {
134125 if (isError) {
135126 writeln(` ${formatErrorBadge(result)}`);
src/llm-api/providers.test.ts+4−8
@@ -5,20 +5,18 @@ import { getThinkingProviderOptions } from "./providers.ts";
55 describe("getThinkingProviderOptions", () => {
66 test("requests OpenAI reasoning summary for GPT reasoning models", () => {
77 expect(
8- getThinkingProviderOptions("openai/gpt-5.3-codex", "medium", false),
8+ getThinkingProviderOptions("openai/gpt-5.3-codex", "medium"),
99 ).toEqual({
1010 openai: { reasoningEffort: "medium", reasoningSummary: "auto" },
1111 });
12- expect(
13- getThinkingProviderOptions("zen/gpt-5.3-codex", "high", false),
14- ).toEqual({
12+ expect(getThinkingProviderOptions("zen/gpt-5.3-codex", "high")).toEqual({
1513 openai: { reasoningEffort: "high", reasoningSummary: "auto" },
1614 });
1715 });
1816
1917 test("returns Gemini 2.5 thinking options even when tools are enabled", () => {
2018 expect(
21- getThinkingProviderOptions("google/gemini-2.5-pro", "medium", true),
19+ getThinkingProviderOptions("google/gemini-2.5-pro", "medium"),
2220 ).toEqual({
2321 google: {
2422 thinkingConfig: {
@@ -30,9 +28,7 @@ describe("getThinkingProviderOptions", () => {
3028 });
3129
3230 test("returns Gemini 3 thinking options for zen models even when tools are enabled", () => {
33- expect(
34- getThinkingProviderOptions("zen/gemini-3.1-pro", "xhigh", true),
35- ).toEqual({
31+ expect(getThinkingProviderOptions("zen/gemini-3.1-pro", "xhigh")).toEqual({
3632 google: {
3733 thinkingConfig: {
3834 includeThoughts: true,
src/llm-api/providers.ts+0−1
@@ -203,7 +203,6 @@ function clampEffort(
203203 export function getThinkingProviderOptions(
204204 modelString: string,
205205 effort: ThinkingEffort,
206- _hasTools = false,
207206 ): Record<string, unknown> | null {
208207 if (!supportsThinking(modelString)) return null;
209208
src/llm-api/turn.ts+1−1
@@ -845,7 +845,7 @@ export async function* runTurn(options: {
845845
846846 const toolCount = Object.keys(toolSet).length;
847847 const thinkingOpts = thinkingEffort
848- ? getThinkingProviderOptions(modelString, thinkingEffort, toolCount > 0)
848+ ? getThinkingProviderOptions(modelString, thinkingEffort)
849849 : null;
850850 const reasoningSummaryRequested =
851851 isRecord(thinkingOpts) &&