-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[3 of 3] Pump trigger-turn work before idle lifecycle #26549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -445,6 +445,15 @@ impl Session { | |
| .await; | ||
| } | ||
|
|
||
| // Keep this detached work in a synchronous helper so the task runner future remains Send. | ||
| fn spawn_post_task_idle_work(self: &Arc<Self>) { | ||
| let session = Arc::clone(self); | ||
| tokio::spawn(async move { | ||
| session.maybe_start_turn_for_pending_work().await; | ||
|
etraut-openai marked this conversation as resolved.
Comment on lines
+451
to
+452
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a turn finishes with Useful? React with 👍 / 👎. |
||
| session.emit_thread_idle_lifecycle_if_idle().await; | ||
| }); | ||
| } | ||
|
|
||
| /// Starts a regular turn with the provided sub-id when pending work should wake an idle | ||
| /// session. | ||
| /// | ||
|
|
@@ -755,7 +764,7 @@ impl Session { | |
| if !cleared_active_turn { | ||
| return; | ||
| } | ||
| self.emit_thread_idle_lifecycle_if_idle().await; | ||
| self.spawn_post_task_idle_work(); | ||
| } | ||
|
|
||
| async fn take_active_turn(&self) -> Option<ActiveTurn> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.