[PR #315] [MERGED] Remove asyncio queue from control_loop #318

Closed
opened 2026-02-16 02:17:13 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/315
Author: @adrianlyjak
Created: 1/30/2026
Status: Merged
Merged: 2/3/2026
Merged by: @adrianlyjak

Base: mainHead: adrian/ticky


📝 Commits (9)

  • 38d5146 refact: remove asyncio queue from control_loop
  • f836617 replace in memory dict with abstract
  • 422e763 clean
  • 4f599ad Create poor-hounds-mix.md
  • 1e1a3fd Update poor-hounds-mix.md
  • 9e3a4d7 Pull in more control loop changes
  • c9b2ccb oops, not that
  • 9076a24 Finalize steps
  • 443df28 protect against scheduling collision

📊 Changes

28 files changed (+2194 additions, -1124 deletions)

View changed files

.changeset/poor-hounds-mix.md (+5 -0)
.changeset/rotten-rabbits-accept.md (+10 -0)
📝 packages/llama-agents-integration-tests/pyproject.toml (+1 -0)
packages/llama-agents-integration-tests/tests/test_runtime_matrix.py (+493 -0)
📝 packages/llama-agents-server/src/llama_agents/server/server.py (+49 -29)
📝 packages/llama-index-workflows/src/llama_agents/workflows/__init__.py (+1 -1)
📝 packages/llama-index-workflows/src/workflows/context/context.py (+17 -7)
📝 packages/llama-index-workflows/src/workflows/context/external_context.py (+4 -4)
📝 packages/llama-index-workflows/src/workflows/context/internal_context.py (+16 -3)
📝 packages/llama-index-workflows/src/workflows/context/pre_context.py (+6 -2)
📝 packages/llama-index-workflows/src/workflows/context/state_store.py (+283 -89)
📝 packages/llama-index-workflows/src/workflows/plugins/basic.py (+35 -15)
📝 packages/llama-index-workflows/src/workflows/runtime/control_loop.py (+239 -91)
packages/llama-index-workflows/src/workflows/runtime/types/named_task.py (+81 -0)
📝 packages/llama-index-workflows/src/workflows/runtime/types/plugin.py (+120 -39)
📝 packages/llama-index-workflows/src/workflows/runtime/types/step_function.py (+3 -1)
packages/llama-index-workflows/src/workflows/runtime/workflow_tracker.py (+0 -75)
📝 packages/llama-index-workflows/src/workflows/workflow.py (+6 -1)
📝 packages/llama-index-workflows/tests/context/test_context.py (+233 -12)
packages/llama-index-workflows/tests/plugins/__init__.py (+0 -0)

...and 8 more files

📄 Description

Splitting off some changes from DBOS work

Control Loop Changes

  • Switches out the asyncio delay mechanism for a pull-with-timeout that is more deterministic friendly
  • Adds a priority queue of delayed tasks
  • Switches out the misc firing /spawning of async tasks to a more rigorous pattern where tasks are only created in the main loop, and gathered in one location. This makes the concurrency more straightforward to reason about
  • Moves the "selecting" of which tasks is completed first into an adapter responsibility, this allows more granular journaling decisions (currently needed to make DBOS determinism work. We end up keeping our own lightweight journal as a workaround until we can figure out a better way to integration)
  • adds a named task around the task to make journaling easier

Misc Changs

  • Removes mypy. 3 type checkers is too many
  • Starts a place for runtime matrix tests. I put these in the integration tests as I expect they will frequently be slow
  • Reduces some test warning changes
  • Fix bug where run_id is not actually passed through from workflow.run

Open with Devin

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/315 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 1/30/2026 **Status:** ✅ Merged **Merged:** 2/3/2026 **Merged by:** [@adrianlyjak](https://github.com/adrianlyjak) **Base:** `main` ← **Head:** `adrian/ticky` --- ### 📝 Commits (9) - [`38d5146`](https://github.com/run-llama/workflows-py/commit/38d5146dd4baf54505ea4c4c2ecdd5a472773d32) refact: remove asyncio queue from control_loop - [`f836617`](https://github.com/run-llama/workflows-py/commit/f836617ef866f181507877b0484f837ee10180c6) replace in memory dict with abstract - [`422e763`](https://github.com/run-llama/workflows-py/commit/422e76310bd5a744411b3bde360c2283d5a09487) clean - [`4f599ad`](https://github.com/run-llama/workflows-py/commit/4f599ad01b5ab8e1c467f1d8d9f6a34c74f4b2ed) Create poor-hounds-mix.md - [`1e1a3fd`](https://github.com/run-llama/workflows-py/commit/1e1a3fdcd80526f72abe6673c99fa073a8abcbf7) Update poor-hounds-mix.md - [`9e3a4d7`](https://github.com/run-llama/workflows-py/commit/9e3a4d728d3583998c762c3dd31080f415983970) Pull in more control loop changes - [`c9b2ccb`](https://github.com/run-llama/workflows-py/commit/c9b2ccb5da9423968f954afc9bd0dd4babe12506) oops, not that - [`9076a24`](https://github.com/run-llama/workflows-py/commit/9076a2479ea10a8cf5a77ecb8c4b01e9dd371c92) Finalize steps - [`443df28`](https://github.com/run-llama/workflows-py/commit/443df2846048c5e0eefaf9e6e821b69ad1e81608) protect against scheduling collision ### 📊 Changes **28 files changed** (+2194 additions, -1124 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/poor-hounds-mix.md` (+5 -0) ➕ `.changeset/rotten-rabbits-accept.md` (+10 -0) 📝 `packages/llama-agents-integration-tests/pyproject.toml` (+1 -0) ➕ `packages/llama-agents-integration-tests/tests/test_runtime_matrix.py` (+493 -0) 📝 `packages/llama-agents-server/src/llama_agents/server/server.py` (+49 -29) 📝 `packages/llama-index-workflows/src/llama_agents/workflows/__init__.py` (+1 -1) 📝 `packages/llama-index-workflows/src/workflows/context/context.py` (+17 -7) 📝 `packages/llama-index-workflows/src/workflows/context/external_context.py` (+4 -4) 📝 `packages/llama-index-workflows/src/workflows/context/internal_context.py` (+16 -3) 📝 `packages/llama-index-workflows/src/workflows/context/pre_context.py` (+6 -2) 📝 `packages/llama-index-workflows/src/workflows/context/state_store.py` (+283 -89) 📝 `packages/llama-index-workflows/src/workflows/plugins/basic.py` (+35 -15) 📝 `packages/llama-index-workflows/src/workflows/runtime/control_loop.py` (+239 -91) ➕ `packages/llama-index-workflows/src/workflows/runtime/types/named_task.py` (+81 -0) 📝 `packages/llama-index-workflows/src/workflows/runtime/types/plugin.py` (+120 -39) 📝 `packages/llama-index-workflows/src/workflows/runtime/types/step_function.py` (+3 -1) ➖ `packages/llama-index-workflows/src/workflows/runtime/workflow_tracker.py` (+0 -75) 📝 `packages/llama-index-workflows/src/workflows/workflow.py` (+6 -1) 📝 `packages/llama-index-workflows/tests/context/test_context.py` (+233 -12) ➕ `packages/llama-index-workflows/tests/plugins/__init__.py` (+0 -0) _...and 8 more files_ </details> ### 📄 Description Splitting off some changes from DBOS work ### Control Loop Changes - Switches out the asyncio delay mechanism for a pull-with-timeout that is more deterministic friendly - Adds a priority queue of delayed tasks - Switches out the misc firing /spawning of async tasks to a more rigorous pattern where tasks are only created in the main loop, and gathered in one location. This makes the concurrency more straightforward to reason about - Moves the "selecting" of which tasks is completed first into an adapter responsibility, this allows more granular journaling decisions (currently needed to make DBOS determinism work. We end up keeping our own lightweight journal as a workaround until we can figure out a better way to integration) - adds a named task around the task to make journaling easier ### Misc Changs - Removes mypy. 3 type checkers is too many - Starts a place for runtime matrix tests. I put these in the integration tests as I expect they will frequently be slow - Reduces some test warning changes - Fix bug where run_id is not actually passed through from workflow.run <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/run-llama/workflows-py/pull/315"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:13 -05:00
yindo closed this issue 2026-02-16 02:17:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#318