feat: Claude Code CLI v2.1.105–v2.1.131 support #274

Merged
naomi merged 7 commits from feat/lotsa into main 2026-05-06 16:16:06 -07:00
2 changed files with 6 additions and 7 deletions
Showing only changes of commit eb2fbda07b - Show all commits
+3 -3
View File
@@ -81,7 +81,7 @@ pub async fn list_sessions(app: AppHandle) -> Result<Vec<SessionListItem>, Strin
let mut items: Vec<SessionListItem> = sessions.iter().map(SessionListItem::from).collect(); let mut items: Vec<SessionListItem> = sessions.iter().map(SessionListItem::from).collect();
// Sort by last activity, most recent first // Sort by last activity, most recent first
items.sort_by(|a, b| b.last_activity_at.cmp(&a.last_activity_at)); items.sort_by_key(|b| std::cmp::Reverse(b.last_activity_at));
Ok(items) Ok(items)
} }
@@ -132,7 +132,7 @@ pub async fn search_sessions(app: AppHandle, query: String) -> Result<Vec<Sessio
.collect(); .collect();
// Sort by last activity, most recent first // Sort by last activity, most recent first
matching.sort_by(|a, b| b.last_activity_at.cmp(&a.last_activity_at)); matching.sort_by_key(|b| std::cmp::Reverse(b.last_activity_at));
Ok(matching) Ok(matching)
} }
@@ -348,7 +348,7 @@ mod tests {
]; ];
// Sort by last activity, most recent first (mimics list_sessions behavior) // Sort by last activity, most recent first (mimics list_sessions behavior)
sessions.sort_by(|a, b| b.last_activity_at.cmp(&a.last_activity_at)); sessions.sort_by_key(|b| std::cmp::Reverse(b.last_activity_at));
assert_eq!(sessions[0].id, "new"); assert_eq!(sessions[0].id, "new");
assert_eq!(sessions[1].id, "old"); assert_eq!(sessions[1].id, "old");
+3 -4
View File
@@ -920,10 +920,9 @@ impl WslBridge {
let stats = self.stats.read(); let stats = self.stats.read();
for tool_name in &tools { for tool_name in &tools {
if let Some(tool_stats) = stats.session_tools_usage.get(tool_name) { if let Some(tool_stats) = stats.session_tools_usage.get(tool_name) {
if tool_stats.call_count > 0 { if let Some(avg_tokens) = (tool_stats.estimated_input_tokens + tool_stats.estimated_output_tokens)
// Use session average tokens per call for this tool .checked_div(tool_stats.call_count)
let avg_tokens = (tool_stats.estimated_input_tokens + tool_stats.estimated_output_tokens) {
/ tool_stats.call_count;
tool_overhead_tokens += avg_tokens; tool_overhead_tokens += avg_tokens;
tracing::info!("[COST ESTIMATION] Tool {} average: {} tokens", tool_name, avg_tokens); tracing::info!("[COST ESTIMATION] Tool {} average: {} tokens", tool_name, avg_tokens);
} }