diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-03 13:05:57 +0200 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-03 13:05:57 +0200 |
| commit | bd1eb9ef9b3b89ff5825eb8bf9b2e978167c9ad0 (patch) | |
| tree | ac3ea2a1f0f2243c692ba5e5fab251df6c9f077b /crates/dinggerd/src/main.rs | |
| parent | 8146d1db419e8bdacd75920da6f3761abf724853 (diff) | |
show each pi agent's context use: a meter in the panel and search, text in the menu
Diffstat (limited to 'crates/dinggerd/src/main.rs')
| -rw-r--r-- | crates/dinggerd/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/dinggerd/src/main.rs b/crates/dinggerd/src/main.rs index 99c10a7..935da7d 100644 --- a/crates/dinggerd/src/main.rs +++ b/crates/dinggerd/src/main.rs @@ -448,7 +448,8 @@ fn mark_unread(pane: Option<String>) -> Result<(), String> { /// Every agent pane in herdr's priority order (blocked, done, working, /// idle), oldest-waiting first within a status. ✎ marks a draft left in -/// the agent's input box. COST is what a pi agent spent today (UTC); the +/// the agent's input box. CTX is how full a pi agent's context window is. +/// COST is what a pi agent spent today (UTC); the /// last line totals today, this week, and this month, closed agents included. fn status() -> Result<(), String> { let mut panes: Vec<_> = tmux::list_panes()? @@ -467,7 +468,7 @@ fn status() -> Result<(), String> { }); let place = |pane: &tmux::Pane| pane.display_target.replacen(':', " · ", 1); let width = panes.iter().map(|pane| place(pane).chars().count()).max().unwrap_or(5).max(5); - println!("{:<8} {:<width$} {:<7} {:>8} NAME", "STATUS", "WHERE", "AGENT", "COST"); + println!("{:<8} {:<width$} {:<7} {:>8} {:>4} NAME", "STATUS", "WHERE", "AGENT", "COST", "CTX"); for pane in &panes { let state = if pane.written_state.is_empty() { "-" } else { &pane.written_state }; let agent = pane.agent.map(detect_core::agent_label).unwrap_or("-"); @@ -478,7 +479,8 @@ fn status() -> Result<(), String> { importance::Importance::Normal => pane.written_name.clone(), }; let cost = if pane.written_cost.is_empty() { String::new() } else { format!("${}", pane.written_cost) }; - println!("{state:<8} {:<width$} {agent:<7} {cost:>8} {draft}{}", place(pane), name.trim()); + let context = if pane.written_context.is_empty() { String::new() } else { format!("{}%", pane.written_context) }; + println!("{state:<8} {:<width$} {agent:<7} {cost:>8} {context:>4} {draft}{}", place(pane), name.trim()); } let global = |name: &str| tmux::show_global(name).unwrap_or_default(); let spent = [("today", "@dingger_cost_today"), ("this week", "@dingger_cost_week"), ("this month", "@dingger_cost_month")] |
