fix: handle non-thinking models correctly in /thinking command (#129)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-13 10:58:49 -06:00
parent bb10aacb23
commit 135390542a

View file

@ -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}`);