Skip to content

Commit a1e8392

Browse files
committed
cargo fmt
1 parent 982bc1d commit a1e8392

2 files changed

Lines changed: 35 additions & 11 deletions

File tree

src/agent/mod.rs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,12 @@ fn repair_tool_call_context(context: &mut Vec<crate::utils::ChatMessage>) {
221221
for id in missing {
222222
context.insert(
223223
j,
224-
crate::utils::ChatMessage::tool("[Cancelled — tool execution interrupted]", &id, None), );
224+
crate::utils::ChatMessage::tool(
225+
"[Cancelled — tool execution interrupted]",
226+
&id,
227+
None,
228+
),
229+
);
225230
j += 1;
226231
}
227232

@@ -1617,10 +1622,14 @@ impl AgentLogic {
16171622
}
16181623
}
16191624
}
1620-
1621-
mem.add_message(crate::utils::ChatMessage::tool(&inbound.content, id, tool_name_for_resume.as_deref()))
1622-
.await
1623-
.map_err(|e| format!("Failed to inject tool response into memory: {}", e))?;
1625+
1626+
mem.add_message(crate::utils::ChatMessage::tool(
1627+
&inbound.content,
1628+
id,
1629+
tool_name_for_resume.as_deref(),
1630+
))
1631+
.await
1632+
.map_err(|e| format!("Failed to inject tool response into memory: {}", e))?;
16241633
} else {
16251634
return Err(format!("Failed to get session {}", session_key));
16261635
}
@@ -2271,8 +2280,12 @@ impl AgentLogic {
22712280
};
22722281
let _ = outbound_tx.send(BusMessage::Telemetry(tfin.clone())).await;
22732282
hook_observe_telemetry(hook_tool_ctx.as_ref(), &inbound, is_subagent, tfin);
2274-
mem.add_message(crate::utils::ChatMessage::tool(&tool_result_text, &tc.id, Some(tool_name.as_str())))
2275-
.await?;
2283+
mem.add_message(crate::utils::ChatMessage::tool(
2284+
&tool_result_text,
2285+
&tc.id,
2286+
Some(tool_name.as_str()),
2287+
))
2288+
.await?;
22762289
}
22772290
tool_invoked = true;
22782291
} else {
@@ -2370,8 +2383,12 @@ impl AgentLogic {
23702383
let _ = outbound_tx.send(BusMessage::Telemetry(tfin.clone())).await;
23712384
hook_observe_telemetry(hook_tool_ctx.as_ref(), &inbound, is_subagent, tfin);
23722385

2373-
mem.add_message(crate::utils::ChatMessage::tool(&tool_result_text, &tc.id, Some(tool_name.as_str())))
2374-
.await?;
2386+
mem.add_message(crate::utils::ChatMessage::tool(
2387+
&tool_result_text,
2388+
&tc.id,
2389+
Some(tool_name.as_str()),
2390+
))
2391+
.await?;
23752392
tool_invoked = true;
23762393
}
23772394
}

src/channels/terminal_ui/run.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,10 @@ pub(crate) fn run_ratatui_main(config: RatatuiMainConfig) -> io::Result<()> {
21982198
let selected_id = if app.ui_focus == TerminalUiFocus::Conversations {
21992199
if let Some(idx) = app.conversations_selected_idx {
22002200
if idx < app.conversations_items.len() {
2201-
Some((app.conversations_items[idx].thread_id.clone(), false))
2201+
Some((
2202+
app.conversations_items[idx].thread_id.clone(),
2203+
false,
2204+
))
22022205
} else {
22032206
None
22042207
}
@@ -2218,7 +2221,11 @@ pub(crate) fn run_ratatui_main(config: RatatuiMainConfig) -> io::Result<()> {
22182221

22192222
if let Some((target_id, is_chat_id)) = selected_id {
22202223
let (thread_id, new_cid) = if is_chat_id {
2221-
let tid = crate::bus::clarification_session_key(channel_name.as_str(), &target_id, None);
2224+
let tid = crate::bus::clarification_session_key(
2225+
channel_name.as_str(),
2226+
&target_id,
2227+
None,
2228+
);
22222229
(tid, target_id)
22232230
} else {
22242231
let cid = match chat_id_from_root_thread_id(

0 commit comments

Comments
 (0)