-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: add task_timeout field support in sub-recipe payloads #3691
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
Conversation
- Add task_timeout extraction from sub_recipe values in create_tasks_from_params - Add get_task_timeout() method to Task struct for future timeout implementation - Include comprehensive tests for timeout field handling - Support both sub_recipe and text_instruction task types This commit adds the foundation for configurable task timeouts by storing the timeout value in task payloads. The actual timeout enforcement will need to be implemented in the task execution layer based on the current architecture. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
DOsinga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
|
let me know if you want to merge this since it says draft |
|
@DOsinga - @lifeizhou-ap mentioned to me here that
So my understanding is that we don't want the feature in this PR, but maybe I'm not reading that correctly? Note that this is in draft because it is entirely coded by Claude Code (I don't have any Rust experience). I'm pretty sure it works as intended, though Lifei's comment makes me wonder if my manual testing was skewed because timeout is already off by default? I'd need to do more testing to feel confident this is achieving the intended behavior relative to current behavior. I'm not sure I will have the capacity to shepherd this change in imminently; if someone wants to take over or implement separately please go ahead. |
|
cc @lifeizhou-ap do you want to take a closer look and indicate if you think it is ok to include? |
|
I added the If I understand correctly, this PR only sets the timeout. So we need to add the "applying timeout" code back. Now the question is: whether we would like to add customised |
|
thanks @lifeizhou-ap - I might close this for now - @tadasant feel free to re-open or ping (probably will need to update things again) if you still want this. |
|
Yeah I don't feel strongly that a timeout needs to exist as a user; I wrote this PR when we were in that in-between phase where the "set the timeout" step didn't have parity with the "apply the timeout" step. But now that timeout is off by default, I think we can skip this. |
Description
This PR adds foundational support for configurable task timeouts in sub-recipes by allowing the
task_timeoutfield to be stored in task payloads and providing a method to extract it.Motivation
Currently, all sub-recipe tasks use a global default timeout. Some sub-recipes may legitimately need more time to complete, such as:
This PR lays the groundwork for implementing task-specific timeouts by:
Implementation Details
Changes Made
Modified
create_tasks_from_paramsinsub_recipe_tools.rs:task_timeoutfrom sub_recipe values if presentAdded
get_task_timeout()method toTaskstruct:Option<u64>with the timeout value in secondssub_recipeandtext_instructiontask typesNoneif no timeout is specified or if the value is invalidAdded comprehensive tests:
Usage Example
Users can specify a timeout in their sub-recipe configuration:
Next Steps
This PR only adds the ability to store and retrieve timeout values. The actual timeout enforcement would need to be implemented in the task execution layer, taking into account the current architecture's use of
TaskConfigand cancellation tokens.Testing
All new functionality is covered by unit tests that verify:
Note on Architecture
The current main branch has a different architecture than v1.1.4, using
TaskConfigand cancellation tokens for task management. This PR provides the data foundation that can be integrated with the existing timeout/cancellation system in a future update.