Skip to content

Conversation

TomeHirata
Copy link
Collaborator

Fixes #8857

@TomeHirata TomeHirata requested a review from Copilot September 26, 2025 04:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request improves error handling in dspy's parallel execution system by properly tracking failed tasks and their associated exceptions. The changes ensure that when parallel processing encounters errors, the system can provide detailed information about which specific tasks failed and what exceptions occurred.

  • Enhanced ParallelExecutor to track failed indices and store exceptions in a mapping structure
  • Modified exception handling to return exception markers instead of None, allowing downstream components to distinguish between successful None results and failed executions
  • Updated the parallel prediction module to properly populate failed examples and exceptions from the executor's tracking data

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
dspy/utils/parallelizer.py Added exception tracking infrastructure and modified error handling to preserve exception information
dspy/predict/parallel.py Enhanced batch processing to extract and return failed examples and exceptions from the executor
tests/utils/test_parallelizer.py Added comprehensive test for verifying exception tracking functionality
tests/predict/test_parallel.py Added test to validate batch processing with failed examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@isaacbmiller
Copy link
Collaborator

isaacbmiller commented Sep 26, 2025

Current implementation looks good but misses the error reported in the initial issue of model_dump being called on a None result.

I am not yet familiar with how SubagentTool works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] batch(...) returns None for failures but leaves failed_examples/exceptions empty in 3.0.3 (breaks SubagentTool.parallel_run)
2 participants