Kill publish_context_state() — screens lock the agent directly

F1 and F2 screens now call agent.context_state_summary() directly
via try_lock/lock instead of reading from a shared RwLock cache.
Removes SharedContextState, publish_context_state(), and
publish_context_state_with_scores().

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-07 03:03:24 -04:00
parent 48c843234d
commit 04e260c081
6 changed files with 30 additions and 64 deletions

View file

@ -863,7 +863,7 @@ impl ScreenView for InteractScreen {
agent.expire_activities();
app.status.prompt_tokens = agent.last_prompt_tokens();
app.status.model = agent.model().to_string();
let sections = agent.shared_context.read().map(|s| s.clone()).unwrap_or_default();
let sections = agent.context_state_summary(None);
app.status.context_budget = crate::agent::context::sections_budget_string(&sections);
app.activity = agent.activities.last()
.map(|a| a.label.clone())