xonecas.io
64875
Mc

mini-coder / commit bcee265

fix(cli): honor verbose mode for shell output rendering

xonecas2026-03-15 bcee2650bf56f87f30e92b21f2567c2754a4a2d5 parent 34f064d

4 files changed

TODO.md+1−0
@@ -1,5 +1,6 @@
11 # TODO
22
3+- Verbose user choice is not persisting accross sessions. Verbose mode should default to off.
34 - Gpt 5.4 shows reasoning correctly, but Gpt 5.3 codex does not. Is this a mini-coder issue?
45
56 ---
src/cli/input-loop.ts+3−1
@@ -114,7 +114,9 @@ export async function runInputLoop(opts: InputLoopOptions): Promise<void> {
114114 cwd,
115115 onOutput: (chunk) => reporter.streamChunk(chunk),
116116 });
117- renderToolResult("shell", result, false);
117+ renderToolResult("shell", result, false, {
118+ verboseOutput: cmdCtx.verboseOutput,
119+ });
118120 const context = buildShellContext(result);
119121 if (context) {
120122 runner.addShellContext(input.command, context);
src/session/db/settings-repo.test.ts+20−0
@@ -0,0 +1,20 @@
1+import { describe, expect, test } from "bun:test";
2+import { parseBooleanSetting } from "./settings-repo.ts";
3+
4+describe("parseBooleanSetting", () => {
5+ test("uses fallback for null and unknown values", () => {
6+ expect(parseBooleanSetting(null, false)).toBe(false);
7+ expect(parseBooleanSetting(null, true)).toBe(true);
8+ expect(parseBooleanSetting("unexpected", false)).toBe(false);
9+ expect(parseBooleanSetting("unexpected", true)).toBe(true);
10+ });
11+
12+ test("accepts common true and false representations", () => {
13+ expect(parseBooleanSetting("true", false)).toBe(true);
14+ expect(parseBooleanSetting("on", false)).toBe(true);
15+ expect(parseBooleanSetting("1", false)).toBe(true);
16+ expect(parseBooleanSetting("false", true)).toBe(false);
17+ expect(parseBooleanSetting("off", true)).toBe(false);
18+ expect(parseBooleanSetting("0", true)).toBe(false);
19+ });
20+});
src/session/db/settings-repo.ts+21−9
@@ -19,6 +19,21 @@ function setSetting(key: string, value: string): void {
1919 );
2020 }
2121
22+export function parseBooleanSetting(
23+ value: string | null,
24+ fallback: boolean,
25+): boolean {
26+ if (value === null) return fallback;
27+ const normalized = value.trim().toLowerCase();
28+ if (normalized === "true" || normalized === "on" || normalized === "1") {
29+ return true;
30+ }
31+ if (normalized === "false" || normalized === "off" || normalized === "0") {
32+ return false;
33+ }
34+ return fallback;
35+}
36+
2237 export function getPreferredModel(): string | null {
2338 return getSetting("preferred_model");
2439 }
@@ -44,9 +59,7 @@ export function setPreferredThinkingEffort(
4459 }
4560
4661 export function getPreferredShowReasoning(): boolean {
47- const v = getSetting("preferred_show_reasoning");
48- if (v === null) return false;
49- return v !== "false";
62+ return parseBooleanSetting(getSetting("preferred_show_reasoning"), false);
5063 }
5164
5265 export function setPreferredShowReasoning(show: boolean): void {
@@ -54,9 +67,7 @@ export function setPreferredShowReasoning(show: boolean): void {
5467 }
5568
5669 export function getPreferredVerboseOutput(): boolean {
57- const v = getSetting("preferred_verbose_output");
58- if (v === null) return false;
59- return v !== "false";
70+ return parseBooleanSetting(getSetting("preferred_verbose_output"), false);
6071 }
6172
6273 export function setPreferredVerboseOutput(verbose: boolean): void {
@@ -100,9 +111,10 @@ export function setPreferredActiveAgent(agent: string | null): void {
100111 }
101112 }
102113 export function getPreferredPromptCachingEnabled(): boolean {
103- const v = getSetting("preferred_prompt_caching_enabled");
104- if (v === null) return true;
105- return v !== "false";
114+ return parseBooleanSetting(
115+ getSetting("preferred_prompt_caching_enabled"),
116+ true,
117+ );
106118 }
107119
108120 export function setPreferredPromptCachingEnabled(enabled: boolean): void {