From 43d3cdd48a62809d253e354123b72215f4cb16b4 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 17 May 2026 00:03:03 +0200 Subject: [PATCH] fix(coding-agent): use configured model scope cycle hint closes #4508 --- packages/coding-agent/CHANGELOG.md | 1 + packages/coding-agent/src/main.ts | 11 ----------- .../src/modes/interactive/interactive-mode.ts | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 3a857254..5f7a6d45 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixed +- Fixed the scoped model startup hint to show the configured model-cycle keybinding ([#4508](https://github.com/earendil-works/pi/issues/4508)). - Fixed `fd` auto-download on macOS x86_64 by pinning the last release that ships an Intel macOS binary ([#4559](https://github.com/earendil-works/pi/issues/4559)). - Fixed skill diagnostics to stop warning when a skill name differs from its parent directory ([#4534](https://github.com/earendil-works/pi/issues/4534)). - Fixed prompt template argument parsing to split unquoted multiline input on newlines ([#4553](https://github.com/earendil-works/pi/issues/4553)). diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 5a29a1fc..72e502be 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -651,7 +651,6 @@ export async function main(args: string[], options?: MainOptions) { await showDeprecationWarnings(deprecationWarnings); } - const scopedModels = [...session.scopedModels]; time("resolveModelScope"); reportDiagnostics(runtime.diagnostics); if (runtime.diagnostics.some((diagnostic) => diagnostic.type === "error")) { @@ -674,16 +673,6 @@ export async function main(args: string[], options?: MainOptions) { printTimings(); await runRpcMode(runtime); } else if (appMode === "interactive") { - if (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) { - const modelList = scopedModels - .map((sm) => { - const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : ""; - return `${sm.model.id}${thinkingStr}`; - }) - .join(", "); - console.log(chalk.dim(`Model scope: ${modelList} ${chalk.gray("(Ctrl+P to cycle)")}`)); - } - const interactiveMode = new InteractiveMode(runtime, { migratedProviders, modelFallbackMessage, diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts index be1c1cb7..a493bf6f 100644 --- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts @@ -572,6 +572,21 @@ export class InteractiveMode { const [fdPath] = await Promise.all([ensureTool("fd"), ensureTool("rg")]); this.fdPath = fdPath; + if (this.session.scopedModels.length > 0 && (this.options.verbose || !this.settingsManager.getQuietStartup())) { + const modelList = this.session.scopedModels + .map((sm) => { + const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : ""; + return `${sm.model.id}${thinkingStr}`; + }) + .join(", "); + const cycleKeys = this.keybindings.getKeys("app.model.cycleForward"); + const cycleHint = + cycleKeys.length > 0 + ? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`) + : ""; + console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`)); + } + // Add header container as first child this.ui.addChild(this.headerContainer);