-
Couldn't load subscription status.
- Fork 1.1k
fix: YAML parser error from diff-style lines in nested lists #2061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
While using pr-agent, I repeatedly ran into YAML parsing errors when using the

describeorimprovetools on GitHub PRs.Here’s one of the error examples I encountered:
I found that the issue was caused by AI-generated diffs inserting diff-style prefixes (
-,+,-+, etc.) inside YAML lists. This confused the parser and caused every fallback in try_fix_yaml to return None.So I added a regression test reproducing the failure and implemented the 5.5 fallback to handle it.

As a result, the previously failing cases now pass cleanly:
PR Type
Bug fix
Description
Fix YAML parser error from diff-style markers in nested lists
Add fallback to normalize diff markers before parsing
Include regression test for diff marker handling
Diagram Walkthrough
File Walkthrough
utils.py
Add YAML diff marker normalization fallbackpr_agent/algo/utils.py
-,+,-+patternstest_try_fix_yaml.py
Add regression test for diff marker handlingtests/unittest/test_try_fix_yaml.py
-,+,-+markers in list items