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:
parent
48c843234d
commit
04e260c081
6 changed files with 30 additions and 64 deletions
|
|
@ -203,7 +203,10 @@ impl AutoAgent {
|
|||
let mut backend = Backend::Forked(forked);
|
||||
let result = self.run_with_backend(&mut backend, None).await;
|
||||
if let Backend::Forked(ref agent) = backend {
|
||||
let total = agent.context.entries.len();
|
||||
self.last_run_entries = agent.context.entries[fork_point..].to_vec();
|
||||
dbglog!("[auto] {} fork_point={} total={} captured={}",
|
||||
self.name, fork_point, total, self.last_run_entries.len());
|
||||
}
|
||||
self.steps = orig_steps;
|
||||
result
|
||||
|
|
@ -214,6 +217,7 @@ impl AutoAgent {
|
|||
backend: &mut Backend,
|
||||
bail_fn: Option<&(dyn Fn(usize) -> Result<(), String> + Sync)>,
|
||||
) -> Result<String, String> {
|
||||
dbglog!("[auto] {} starting, {} steps", self.name, self.steps.len());
|
||||
self.turn = 0;
|
||||
self.outputs.clear();
|
||||
self.current_phase = self.steps.first()
|
||||
|
|
@ -235,6 +239,9 @@ impl AutoAgent {
|
|||
backend.log(format!("turn {} ({} messages)",
|
||||
self.turn, messages.len()));
|
||||
|
||||
dbglog!("[auto] {} turn {} ({} messages)",
|
||||
self.name, self.turn, messages.len());
|
||||
|
||||
let (msg, usage_opt) = Self::api_call_with_retry(
|
||||
&self.name, backend, &self.tools, &messages,
|
||||
&reasoning, self.sampling, self.priority).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue