Skip to content

Fix: preserve --protect-tests during agentic fallback#1085

Open
imradawoodani wants to merge 3 commits into
promptdriven:mainfrom
imradawoodani:fix/protect-tests-agentic-fallback
Open

Fix: preserve --protect-tests during agentic fallback#1085
imradawoodani wants to merge 3 commits into
promptdriven:mainfrom
imradawoodani:fix/protect-tests-agentic-fallback

Conversation

@imradawoodani
Copy link
Copy Markdown

Fixes #771

What changed

  • Added a regression test in tests/test_fix_error_loop.py to ensure
    protect_tests=True is forwarded into the agentic fallback helper.
  • Updated pdd/pdd/fix_error_loop.py so _safe_run_agentic_fix() accepts
    protect_tests and every fallback path passes it through to run_agentic_fix().

Why

When pdd fix --loop --protect-tests falls back to agentic mode, the
flag was previously dropped and the fallback agent could modify tests.
This fix preserves the user’s intent and prevents test files from being
edited during agentic fallback.

Testing

  • export PDD_PATH=$(pwd)
  • pytest -q tests/test_fix_error_loop.py -k protect_tests
  • pytest -q tests/test_fix_error_loop.py

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@gltanaka
Copy link
Copy Markdown
Contributor

target 5/21

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.

pdd fix: --protect-tests flag is dropped when falling back to agentic mode

2 participants