mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
Add experimental thread job scheduler for /loop
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user