Add experimental thread job scheduler for /loop

This commit is contained in:
Eric Traut
2026-03-30 15:30:34 -06:00
parent 716f7b0428
commit a02c2cd50c
52 changed files with 2291 additions and 113 deletions
+4 -2
View File
@@ -172,13 +172,13 @@ impl Session {
self.start_task(turn_context, input, task).await;
}
async fn start_task<T: SessionTask>(
pub(crate) async fn start_task<T: SessionTask>(
self: &Arc<Self>,
turn_context: Arc<TurnContext>,
input: Vec<UserInput>,
task: T,
) {
let task: Arc<dyn SessionTask> = Arc::new(task);
let task: Arc<dyn SessionTask + Send + Sync> = Arc::new(task);
let task_kind = task.kind();
let span_name = task.span_name();
let started_at = Instant::now();
@@ -436,6 +436,8 @@ impl Session {
last_agent_message,
});
self.send_event(turn_context.as_ref(), event).await;
self.mark_after_turn_jobs_due().await;
self.maybe_start_pending_job().await;
}
async fn take_active_turn(&self) -> Option<ActiveTurn> {