Skip to content

fix: scope merge auto-recovery state per experiment - #1440

Open
XianBW wants to merge 1 commit into
mainfrom
xianbw-fix-merge-auto-recovery-state
Open

fix: scope merge auto-recovery state per experiment#1440
XianBW wants to merge 1 commit into
mainfrom
xianbw-fix-merge-auto-recovery-state

Conversation

@XianBW

@XianBW XianBW commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Replace merge-phase mutations of the process-wide DS_RD_SETTING.coding_fail_reanalyze_threshold and DS_RD_SETTING.consecutive_errors values with an explicit is_merge_phase marker on each generated DSExperiment.

DataScienceRDLoop.record() now skips auto-recovery only for the merge-phase experiment being recorded. All four merge generation paths set this marker, including the parallel multi-trace router.

Regression tests cover the synchronous merge generators, parallel merge generation, unchanged global thresholds, and the default non-merge state.

Motivation and Context

Fixes #1431.

The previous implementation permanently changed a shared settings singleton. That disabled auto-recovery for later iterations and could leak across concurrent traces. A temporary context manager around ExpGen.gen() would restore values before record() performs the recovery check, so the state instead travels with the experiment through its full iteration lifecycle.

How Has This Been Tested?

  • If you are adding a new feature, test on your own test scripts.

Targeted tests were added under test/data_science/test_merge_auto_recovery.py. Local execution was omitted at the request of the submitter.

Screenshots of Test Results (if appropriate):

  1. Your own tests: N/A

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--1440.org.readthedocs.build/en/1440/

Replace process-wide threshold mutations with an experiment-level merge-phase marker so parallel traces cannot leak recovery state across iterations. Add regression coverage for all merge generators.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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: Merge-phase ExpGen permanently disables DS_RD_SETTING.consecutive_errors and coding_fail_reanalyze_threshold (no restore)

1 participant