[PR #102] [MERGED] fix wait_for_event when you have a custom context state definition #120

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

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/102
Author: @logan-markewich
Created: 9/16/2025
Status: Merged
Merged: 9/17/2025
Merged by: @masci

Base: mainHead: logan/fix_wait_for_event


📝 Commits (3)

  • 164a15a Do not write to store on users behalf
  • 4130471 fix rountrip hitl serialization
  • 221ea56 remove finally clause

📊 Changes

2 files changed (+74 additions, -22 deletions)

View changed files

📝 src/workflows/context/context.py (+23 -20)
📝 tests/context/test_context.py (+51 -2)

📄 Description

The wait_for_event() function has a major flaw -- it writes to the state on the users behalf.

This breaks down majorly in a few ways

  1. For custom state models, this will fail unless the workflow inherits from DictLikeModel
  2. Our serialization does not handle round-trips will for combinations of DictLikeModel AND BaseModel (its meant to be either-or, either you have a fully typed state or you don't)

This PR fixes both


🔄 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/102 **Author:** [@logan-markewich](https://github.com/logan-markewich) **Created:** 9/16/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `logan/fix_wait_for_event` --- ### 📝 Commits (3) - [`164a15a`](https://github.com/run-llama/workflows-py/commit/164a15aab0611dc031a63db47d55c240b8e2ac5d) Do not write to store on users behalf - [`4130471`](https://github.com/run-llama/workflows-py/commit/4130471c0f5d4f49101f60c0ff7d587a4eb4bf7e) fix rountrip hitl serialization - [`221ea56`](https://github.com/run-llama/workflows-py/commit/221ea56f5d86af7f440161dff91cd85130b4d7b6) remove finally clause ### 📊 Changes **2 files changed** (+74 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/workflows/context/context.py` (+23 -20) 📝 `tests/context/test_context.py` (+51 -2) </details> ### 📄 Description The `wait_for_event()` function has a major flaw -- it writes to the state on the users behalf. This breaks down majorly in a few ways 1. For custom state models, this will fail unless the workflow inherits from DictLikeModel 2. Our serialization does not handle round-trips will for combinations of DictLikeModel AND BaseModel (its meant to be either-or, either you have a fully typed state or you don't) This PR fixes both --- <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:16:39 -05:00
yindo closed this issue 2026-02-16 02:16:39 -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#120