-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Preserve parent-child relationship when cancelling subtasks #1564
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
fix: Preserve parent-child relationship when cancelling subtasks #1564
Conversation
This commit fixes an issue where subtasks weren't properly reporting back to parent tasks when cancelled and resumed. Previously, when a subtask was cancelled and a new task was started with the same message, the parent task would incorrectly resume, causing unexpected behavior. The fix: 1. Stores parent-child relationship information before cancelling a task 2. Restores this relationship after task reinitialization 3. Ensures parent tasks only resume when explicitly instructed to do so This approach maintains the correct task hierarchy throughout the cancellation and resumption process, preventing parent tasks from automatically resuming when unrelated tasks with similar messages are started.
|
|
cool, lgtm :D |
|
@cannuri - Can you take a look at the integration test? It's not working in CI and I can't get it to work locally. |
I think there's a race condition when attempting to validate messages for different tasks. For example, if you spawn a subtask and then immediately look for a particular message in the parent task's |
Also, I think the e2e tests aren't run on branches on forks (since the fork won't have access to the OpenRouter API key stored as a secret in GitHub), so it will look like CI passed until your branch gets merged. |
Context
This commit fixes an issue where subtasks weren't properly reporting back to parent tasks when cancelled and resumed. Previously, when a subtask was cancelled and a new task was started with the same message, the parent task would incorrectly resume, causing unexpected behavior.
This fixes #1547
Implementation
The fix:
This approach maintains the correct task hierarchy throughout the cancellation and resumption process, preventing parent tasks from automatically resuming when unrelated tasks with similar messages are started.
How to Test