feat(agent): implement agent execution engine and turn handling with background processing
This commit is contained in:
@@ -97,7 +97,13 @@ fn draw_usage_widget(frame: &mut Frame, area: Rect, state: &crate::state::AppSta
|
||||
let now_ms = chrono::Utc::now().timestamp_millis();
|
||||
let summary = compute_usage_summary(&rt.usage, rt.session_start, now_ms);
|
||||
let max_tokens = crate::state::resolve_context_window(&state.app_config, &state.settings);
|
||||
let current_tokens = state.cached_token_count;
|
||||
let current_tokens = if rt.usage.last_tokens_in > 0 {
|
||||
// Actual context window used by the LLM (includes system prompt + tree)
|
||||
rt.usage.last_tokens_in as usize
|
||||
} else {
|
||||
// Fallback for brand new sessions before the first API call
|
||||
state.cached_token_count
|
||||
};
|
||||
|
||||
let mut items = vec![
|
||||
Line::from(Span::styled(
|
||||
|
||||
Reference in New Issue
Block a user