From 3f45182b5ba76293e234cb4f95f28abe0bf1998d Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 8 Apr 2026 09:24:13 -0700 Subject: [PATCH 1/3] initial fix for https://github.com/antinomyhq/forgecode/issues/2846 --- crates/forge_main/src/ui.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index 5ba5de69e4..3bf71496e3 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -192,6 +192,11 @@ impl A + Send + Sync> UI // Update the app config with the new operating agent. self.api.set_active_agent(agent.id.clone()).await?; + + // Update model tracking to reflect the new agent's model + let model = self.get_agent_model(Some(agent.id.clone())).await; + self.update_model(model.clone()); + let name = agent.id.as_str().to_case(Case::UpperSnake).bold(); let title = format!( @@ -199,7 +204,13 @@ impl A + Send + Sync> UI agent.title.as_deref().unwrap_or(MISSING_AGENT_TITLE) ) .dimmed(); - self.writeln_title(TitleFormat::action(format!("{name} {title}")))?; + + // Show model info if agent uses a specific model + let model_info = model + .map(|m| format!(" ∙ model: {m}").dimmed().to_string()) + .unwrap_or_default(); + + self.writeln_title(TitleFormat::action(format!("{name} {title}{model_info}")))?; Ok(()) } From a33c1156043fc75019bab0c8ad08d7a3e8afb633 Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 8 Apr 2026 14:20:46 -0700 Subject: [PATCH 2/3] fix errant missing element --- crates/forge_main/src/built_in_commands.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/forge_main/src/built_in_commands.json b/crates/forge_main/src/built_in_commands.json index c574c6f8a0..d73a40dee1 100644 --- a/crates/forge_main/src/built_in_commands.json +++ b/crates/forge_main/src/built_in_commands.json @@ -8,6 +8,7 @@ "description": "Display effective resolved configuration in TOML format" }, { + "command": "config-model", "description": "Switch the models [alias: cm]" }, { @@ -138,4 +139,4 @@ "command": "setup", "description": "Setup zsh integration by updating .zshrc" } -] +] \ No newline at end of file From 3794da5e7082bce1ca314f38fb732a417a0569cc Mon Sep 17 00:00:00 2001 From: Jeff Bryner Date: Wed, 8 Apr 2026 14:21:35 -0700 Subject: [PATCH 3/3] fix :agent in zsh to choose agent model instead of default model --- crates/forge_main/src/ui.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index 3bf71496e3..414db4585d 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -3727,8 +3727,13 @@ impl A + Send + Sync> UI .filter(|text| !text.trim().is_empty()) .and_then(|str| ConversationId::from_str(str.as_str()).ok()); + let agent_id = std::env::var("_FORGE_ACTIVE_AGENT") + .ok() + .filter(|text| !text.trim().is_empty()) + .map(AgentId::new); + // Make IO calls in parallel - let (model_id, conversation) = tokio::join!(self.api.get_default_model(), async { + let (model_id, conversation) = tokio::join!(self.get_agent_model(agent_id.clone()), async { if let Some(cid) = cid { self.api.conversation(&cid).await.ok().flatten() } else { @@ -3755,12 +3760,7 @@ impl A + Send + Sync> UI .unwrap_or(true); // Default to true let rprompt = ZshRPrompt::from_config(&self.config) - .agent( - std::env::var("_FORGE_ACTIVE_AGENT") - .ok() - .filter(|text| !text.trim().is_empty()) - .map(AgentId::new), - ) + .agent(agent_id) .model(model_id) .token_count(conversation.and_then(|conversation| conversation.token_count())) .cost(cost)