Refactor WorkflowRuner and Scheduler to handling partially completed tasks#530
Conversation
|
/unittest-diff |
Summary
Failed Tests
Skipped
Tests
Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Pull request overview
Adds optional support for returning partially completed tasks during scheduler over-rollout cleanup, with more granular run-level success reporting via an updated Status model.
Changes:
- Introduces
OverRolloutConfig.return_partial_tasksand validates it in config validation. - Refactors runner/scheduler result handling to track
completed_runsvstotal_runsand optionally emit partial task results during cleanup. - Extends tests to cover partial-success behavior and updates an agentscope dependency constraint.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
trinity/explorer/workflow_runner.py |
Refactors execution to aggregate per-run outcomes into Status(completed_runs/total_runs) and supports partial collection/fail-fast modes. |
trinity/explorer/scheduler.py |
Tracks per-task aggregated results across subtasks and can emit partially completed tasks during cleanup. |
trinity/explorer/explorer.py |
Threads return_partial_tasks flag through scheduler result collection for explore/eval steps. |
trinity/common/config_validator.py |
Extends over-rollout validation to cover return_partial_tasks and updates an error message. |
trinity/common/config.py |
Adds return_partial_tasks option to OverRolloutConfig. |
tests/trainer/trainer_test.py |
Enables return_partial_tasks in an over-rollout trainer integration test configuration. |
tests/explorer/workflow_test.py |
Adds runner tests for partial success + fail-fast behavior across concurrent modes; adjusts agentscope adapter test. |
tests/explorer/scheduler_test.py |
Adds scheduler test verifying partial task emission during over-rollout cleanup. |
pyproject.toml |
Bumps agentscope[tuner] minimum version to >=1.0.19. |
Comments suppressed due to low confidence (1)
trinity/explorer/scheduler.py:189
run_with_retry’s docstring wasn’t updated for the newcollect_partial_runsparameter, so it’s unclear how this flag affects runner execution and retries. Please document the parameter and its semantics (e.g., whether it controls fail-fast vs collecting partial successes across repeats).
"""
Args:
task (`TaskWrapper`): The task to run.
repeat_times (`int`): The number of times to repeat the task.
run_id_base (`int`): The base run id for this task runs.
timeout (`float`): The timeout for each task run.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/unittest-diff |
Summary
Failed Tests
Skipped
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-pattern-test_over_rollout_return_partial_tasks |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-module-trainer |
Summary
Skipped
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-diff |
Summary
Skipped
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-module-explorer |
Summary
Tests
Github Test Reporter by CTRF 💚 |
Description
This pull request introduces support for handling and returning partially completed tasks in the scheduler during over-rollout scenarios. It adds a new configuration option to control this behavior, updates the scheduler logic to track partial completions and emit partial results, and extends the test suite to verify correct handling of partial successes. The changes also refactor the
Statusclass to track the number of completed and total runs, improving the granularity of task completion status.Partial Task Handling and Over-Rollout Improvements:
return_partial_tasksinOverRolloutConfigto control whether tasks with partial successful runs are returned during over-rollout cleanup. (trinity/common/config.py)trinity/explorer/scheduler.py) [1] [2] [3] [4] [5] [6] [7] [8]return_partial_tasksflag to the scheduler when retrieving results for both exploration and evaluation steps. (trinity/explorer/explorer.py) [1] [2]Status Tracking and Refactoring:
Statusclass to trackcompleted_runsandtotal_runsinstead of a simpleokboolean, with a property to determine overall success. Added a newRunnerExecutionResultdataclass for clarity. (trinity/explorer/workflow_runner.py)Statusstructure, ensuring accurate reporting of partial completions and error messages. (trinity/explorer/scheduler.py) [1] [2] [3]Testing Enhancements:
tests/explorer/scheduler_test.py,tests/explorer/workflow_test.py) [1] [2] [3] [4] [5]These changes provide better observability and control over task execution in distributed or unreliable environments, ensuring that partially successful work is not lost and is properly reported.
Checklist
Please check the following items before code is ready to be reviewed.