Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Late background watchers can overwrite a cancelled task as
completedorfailed, and duplicate callbacks can replace a finished task's result and enqueue another notification. Allowcomplete()andfail()to transition only running tasks, preserving the first terminal state and its timestamp/result/error.Adds regression coverage for both watcher callbacks after cancellation and all completed/failed callback combinations. Existing normal completion/failure paths remain covered.
Validation (Python 3.12.13, Windows, upstream
a56afcc):python -m pytest tests/utils/test_task_manager_smoke.py -k TestTaskManager -q: 12 passed, 4 subtests passed.TestAgentToolTranscript.test_save_transcript_writes_message_objects_and_dictsandtest_plugin_tools_are_available_without_an_explicit_shell_env.pytest tests -q --maxfail=1cannot collect on Windows:tests/release/test_business_distribution.pyimports Unix-onlyfcntl.git diff --checkpasses.This preserves task state only. It does not change process termination or process-group handling (the latter is covered separately in #962).
AI assistance: Codex implemented the change, ran the offline regressions and reviewed the diff. No live model calls or credentials were used in the tests.