From 135390542a0605cf7ca33ef3ad4e722f371b97a4 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Fri, 13 Mar 2026 10:58:49 -0600 Subject: [PATCH] fix: handle non-thinking models correctly in /thinking command (#129) Co-Authored-By: Claude Opus 4.6 --- .../src/modes/interactive/interactive-mode.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts b/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts index b1fb49001..fbbcf3b74 100644 --- a/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts @@ -2752,19 +2752,20 @@ export class InteractiveMode { } private handleThinkingCommand(arg?: string): void { - const availableLevels = this.session.getAvailableThinkingLevels(); - if (availableLevels.length === 0) { + if (!this.session.supportsThinking()) { this.showStatus("Current model does not support thinking"); return; } + const availableLevels = this.session.getAvailableThinkingLevels(); + if (arg) { - const level = arg.toLowerCase() as ThinkingLevel; - if (!availableLevels.includes(level)) { + const level = arg.toLowerCase(); + if (!availableLevels.includes(level as ThinkingLevel)) { this.showStatus(`Invalid thinking level "${arg}". Available: ${availableLevels.join(", ")}`); return; } - this.session.setThinkingLevel(level); + this.session.setThinkingLevel(level as ThinkingLevel); this.footer.invalidate(); this.updateEditorBorderColor(); this.showStatus(`Thinking level: ${level}`);