mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
merge main into code-branch-20250919-064824 before merge
This commit is contained in:
@@ -1719,17 +1719,15 @@ impl WidgetRef for ChatComposer {
|
||||
let mut token_spans: Vec<Span> = Vec::new();
|
||||
if let Some(token_usage_info) = &self.token_usage_info {
|
||||
let turn_usage = &token_usage_info.last_token_usage;
|
||||
let turn_tokens = turn_usage.blended_total();
|
||||
let used_str = format_with_thousands(turn_tokens);
|
||||
let tokens_used = turn_usage.tokens_in_context_window();
|
||||
let used_str = format_with_thousands(tokens_used);
|
||||
token_spans.push(Span::from(used_str).style(label_style.add_modifier(Modifier::BOLD)));
|
||||
token_spans.push(Span::from(" tokens").style(label_style));
|
||||
if let Some(context_window) = token_usage_info.model_context_window {
|
||||
if context_window > 0 {
|
||||
let percent_remaining = {
|
||||
let percent = 100.0
|
||||
- (turn_usage.tokens_in_context_window() as f32
|
||||
/ context_window as f32
|
||||
* 100.0);
|
||||
- (tokens_used as f32 / context_window as f32 * 100.0);
|
||||
percent.clamp(0.0, 100.0) as u8
|
||||
};
|
||||
token_spans.push(Span::from(" (").style(label_style));
|
||||
|
||||
@@ -3965,7 +3965,7 @@ impl HistoryCell for RunningToolCallCell {
|
||||
fn gutter_symbol(&self) -> Option<&'static str> {
|
||||
if self.title == "Waiting" {
|
||||
if self.wait_has_call_id {
|
||||
Some("⚙")
|
||||
None
|
||||
} else {
|
||||
Some(self.spinner_frame())
|
||||
}
|
||||
|
||||
@@ -139,9 +139,11 @@ pub async fn auto_upgrade_if_enabled(config: &Config) -> anyhow::Result<Option<S
|
||||
}
|
||||
|
||||
let resolution = resolve_upgrade_resolution();
|
||||
let (command, display) = match resolution {
|
||||
UpgradeResolution::Command { command, display } if !command.is_empty() => {
|
||||
(command, display)
|
||||
let (command, command_display) = match resolution {
|
||||
UpgradeResolution::Command {
|
||||
command,
|
||||
display: command_display,
|
||||
} if !command.is_empty() => (command, command_display),
|
||||
}
|
||||
_ => {
|
||||
info!("auto-upgrade enabled but no managed installer detected; skipping");
|
||||
@@ -175,8 +177,8 @@ pub async fn auto_upgrade_if_enabled(config: &Config) -> anyhow::Result<Option<S
|
||||
};
|
||||
|
||||
info!(
|
||||
command = %display,
|
||||
latest_version = %latest_version,
|
||||
command = command_display.as_str(),
|
||||
latest_version = latest_version.as_str(),
|
||||
"auto-upgrade: running managed installer"
|
||||
);
|
||||
let result = run_upgrade_command(command).await;
|
||||
|
||||
Reference in New Issue
Block a user