Skip to content

fix: restore DS_RD_SETTING auto-recovery thresholds after merge phase (#1431)#1433

Open
utsab345 wants to merge 1 commit into
microsoft:mainfrom
utsab345:fix/merge-phase-auto-recovery-restore
Open

fix: restore DS_RD_SETTING auto-recovery thresholds after merge phase (#1431)#1433
utsab345 wants to merge 1 commit into
microsoft:mainfrom
utsab345:fix/merge-phase-auto-recovery-restore

Conversation

@utsab345

@utsab345 utsab345 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1431 by ensuring temporary merge-phase overrides of DS_RD_SETTING.coding_fail_reanalyze_threshold and DS_RD_SETTING.consecutive_errors are always restored after merge generation completes.

What changed

  • Added a context manager to temporarily disable auto-recovery during merge-phase experiment generation.
  • Restored the original DS_RD_SETTING values using try/finally, ensuring restoration even if an exception occurs.
  • Replaced the repeated global setting mutations in all affected merge-phase call sites with the shared helper.

Why

Previously, merge-phase execution permanently modified the process-wide DS_RD_SETTING singleton:

  • coding_fail_reanalyze_threshold
  • consecutive_errors

Because these values were never restored, the auto-recovery logic in DataScienceRDLoop.record() became effectively disabled for the remainder of the process, causing failed coding iterations to continue retrying indefinitely instead of triggering the intended restart/reanalysis behavior.

This change scopes the override to the duration of merge-phase execution only and restores the original behavior immediately afterward.

Testing

  • python -m py_compile passed for the modified modules.
  • Offline tests passed.
  • Full test suite: 81 passed, 29 failed.
  • Import test (test_import_modules) passed, including 299 subtests, confirming the modified modules import correctly.

The 29 failing tests are pre-existing and unrelated to this change (API keys, Docker, Kaggle authentication, etc.).

Branch

fix/merge-phase-auto-recovery-restore

Commit

d211204

Closes #1431.


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

Wrap the four merge-phase ExpGen call sites with a context manager
(_disable_auto_recovery) that saves and restores
DS_RD_SETTING.coding_fail_reanalyze_threshold and
DS_RD_SETTING.consecutive_errors, so the auto-recovery logic in
DataScienceRDLoop.record remains reachable after merge phase ends.
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