generated from nhcarrigan/template
feat: display per-agent model override in agent monitor tree
Parse the model field from Agent/Task tool input and surface it in the agent monitor panel as a purple subtitle, so users can immediately see which agents are running on a non-default model. Closes #207
This commit is contained in:
@@ -292,6 +292,8 @@ pub struct AgentStartEvent {
|
||||
pub conversation_id: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub parent_tool_use_id: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub model: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
@@ -1301,14 +1301,19 @@ fn process_json_line(
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("unknown")
|
||||
.to_string();
|
||||
let model = input
|
||||
.get("model")
|
||||
.and_then(|v| v.as_str())
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| s.to_string());
|
||||
let now = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.as_millis() as u64;
|
||||
|
||||
tracing::debug!(
|
||||
"Emitting agent-start: id={}, desc={}, type={}, parent={:?}",
|
||||
id, description, subagent_type, parent_tool_use_id
|
||||
"Emitting agent-start: id={}, desc={}, type={}, model={:?}, parent={:?}",
|
||||
id, description, subagent_type, model, parent_tool_use_id
|
||||
);
|
||||
|
||||
let _ = app.emit(
|
||||
@@ -1318,6 +1323,7 @@ fn process_json_line(
|
||||
agent_id: None, // Will be updated when SubagentStart hook is received
|
||||
description,
|
||||
subagent_type,
|
||||
model,
|
||||
started_at: now,
|
||||
conversation_id: conversation_id.clone(),
|
||||
parent_tool_use_id: parent_tool_use_id.clone(),
|
||||
|
||||
Reference in New Issue
Block a user