Skip to content

DSPy

The DSPy pack checks deprecated modules, deprecated signature field arguments, module runtime safety, concurrency, and optimizer configurations against DSPy 3.5 on files that import dspy.

Rules Safe fix Unsafe fix Manual fix
11 1 0 10
Rule Severity Fix What it finds
deprecated-react-v2 warning safe dspy.ReActV2 is a deprecated compatibility alias for dspy.ReAct in DSPy 3.5 and is scheduled for removal in DSPy 3.6.
deprecated-two-step-adapter warning none dspy.TwoStepAdapter is deprecated in DSPy 3.5 and will be removed in DSPy 3.6.
deprecated-field-args warning none The prefix, format, and parser arguments on dspy.InputField and dspy.OutputField are deprecated in DSPy and have no effect at runtime.
direct-forward-call warning none Calling .forward(...) directly on a dspy.Module or predictor skips Module.call, which breaks callbacks, MLflow tracing, dspy.track_usage, and optimizer trace capture.
configure-in-forward error none dspy.configure(...) mutates process-wide settings and raises a thread-ownership error when called from worker threads during dspy.Evaluate, dspy.Parallel, or optimizer runs.
cache-disabled-in-module warning none Disabling DSPy's response cache inside a dspy.Module defeats disk and memory caching across repeated evaluations and optimizer trials.
unbounded-react-iters warning none dspy.ReAct(...) defaults to max_iters=20, allowing runaway tool loops to burn latency and tokens when an explicit iteration cap is not set.
Rule Severity Fix What it finds
single-threaded-eval warning none dspy.Evaluate(...) defaults to num_threads=None, executing evaluation examples sequentially on a single thread and magnifying wall-clock latency.
deprecated-signature-optimizer warning none dspy.SignatureOptimizer is deprecated in DSPy and prints a removal warning on construction.
mipro-v2-invalid-auto error none dspy.MIPROv2(auto=...) validates auto against {None, "light", "medium", "heavy"} and raises ValueError for any other string.
gepa-track-best-outputs-without-stats error none dspy.GEPA(..., track_best_outputs=True) asserts that track_stats is True, and track_stats defaults to False.