Skip to content

fix(settings): restore missing large PR handling config for pr_description#2234

Merged
naorpeled merged 3 commits intoqodo-ai:mainfrom
Hank076:main
Mar 13, 2026
Merged

fix(settings): restore missing large PR handling config for pr_description#2234
naorpeled merged 3 commits intoqodo-ai:mainfrom
Hank076:main

Conversation

@Hank076
Copy link
Copy Markdown
Contributor

@Hank076 Hank076 commented Feb 25, 2026

User description

Problem

Related #2230

Running python -m pr_agent.cli --pr_url="..." describe fails immediately with:

WARNING | pr_agent.algo.pr_processing:retry_with_fallback_models:333 - Failed to generate prediction with

All fallback models exhaust within a few milliseconds — no API call is
ever made.

Root Cause

pr_description.py line 208 reads:

large_pr_handling = get_settings().pr_description.enable_large_pr_handling and ...

The keys enable_large_pr_handling, max_ai_calls, and async_ai_calls
were removed from the [pr_description] section of
settings/configuration.toml. When the key is missing, get_settings()
raises an exception inside _prepare_prediction(), before get_pr_diff
is reached. retry_with_fallback_models() catches any Exception and
logs it as a prediction failure, silently exhausting every model in the
fallback list.

This is why the failure is /describe-specific: other tools do not
access pr_description.enable_large_pr_handling.

Fix

Restore the three missing settings under [pr_description] in
settings/configuration.toml:

# large pr mode
enable_large_pr_handling=true
max_ai_calls=4
async_ai_calls=true

How to Reproduce

Use the latest Docker image and run:

python -m pr_agent.cli --pr_url="<any_valid_pr_url>" describe

Observe all models fail instantly with no get_pr_diff log output,
while review and improve on the same PR work fine.


___

### **PR Type**
Bug fix


___

### **Description**
- Restore missing large PR handling configuration keys

- Fixes describe command failing with all models exhausted

- Re-adds enable_large_pr_handling, max_ai_calls, async_ai_calls settings


___

### Diagram Walkthrough


```mermaid
flowchart LR
A["Missing config keys<br/>in configuration.toml"] -->|causes| B["Exception in<br/>_prepare_prediction"]
B -->|caught by| C["retry_with_fallback_models"]
C -->|silently exhausts| D["All models fail<br/>instantly"]
E["Restore three keys:<br/>enable_large_pr_handling<br/>max_ai_calls<br/>async_ai_calls"] -->|fixes| A

File Walkthrough

Relevant files
Bug fix
configuration.toml
Add missing large PR handling configuration keys                 

pr_agent/settings/configuration.toml

  • Added enable_large_pr_handling=true configuration key
  • Added max_ai_calls=4 configuration key
  • Added async_ai_calls=true configuration key
  • Placed under [pr_description] section with descriptive comment
+4/-0     

…ption

  The `enable_large_pr_handling`, `max_ai_calls`, and `async_ai_calls`
  keys were removed from the `[pr_description]` section in
  `settings/configuration.toml`, but `pr_description.py` still accesses
  `get_settings().pr_description.enable_large_pr_handling` at runtime.

  When the key is absent, an exception is raised inside
  `_prepare_prediction()` before `get_pr_diff` is even called.
  `retry_with_fallback_models()` catches it silently and logs
  "Failed to generate prediction", causing all configured models to
  exhaust in milliseconds with no actual API call ever made.

  Fixes qodo-ai#2230
@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects bot commented Feb 25, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #2230
🟢 Restore missing [pr_description] configuration keys required by pr_description.py
(enable_large_pr_handling, max_ai_calls, async_ai_calls) so get_settings() does not raise
when preparing the prediction.
Fix the describe command failure in the latest Docker image where all fallback models are
exhausted immediately without making an API call.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Consistent Naming Conventions

Objective: All new variables, functions, and classes must follow the project's established naming
standards

Status: Passed

No Dead or Commented-Out Code

Objective: Keep the codebase clean by ensuring all submitted code is active and necessary

Status: Passed

Robust Error Handling

Objective: Ensure potential errors and edge cases are anticipated and handled gracefully throughout
the code

Status: Passed

Single Responsibility for Functions

Objective: Each function should have a single, well-defined responsibility

Status: Passed

When relevant, utilize early return

Objective: In a code snippet containing multiple logic conditions (such as 'if-else'), prefer an
early return on edge cases than deep nesting

Status: Passed

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects bot commented Feb 25, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Ensure settings are in correct section

Place the new large PR handling settings under a [pr_description] section header
to ensure they are correctly scoped and applied to the intended tool.

pr_agent/settings/configuration.toml [113-119]

 #custom_labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Enhancement', 'Documentation', 'Other']
+
+[pr_description]
 # large pr mode 💎
 enable_large_pr_handling=true
 max_ai_calls=4
 async_ai_calls=true
 
 [pr_questions] # /ask #
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical issue where new configuration options might be applied to the wrong section, leading to a misconfiguration, which is a functional bug.

High
  • Update
  • Author self-review: I have reviewed the PR code suggestions, and addressed the relevant ones.

@drew-simmons
Copy link
Copy Markdown

I think inline_file_summary = false is missing too.

https://github.com/qodo-ai/pr-agent/blob/v0.31/pr_agent/settings/configuration.toml#L122

@naorpeled
Copy link
Copy Markdown
Collaborator

naorpeled commented Mar 6, 2026

Hey @Hank076,
thanks for this, you rock 😎 🙏

Could you please address the comments by @drew-simmons and me?
Afterwards, I'll gladly merge this.

@PeterDaveHello
Copy link
Copy Markdown
Contributor

We need this with a new release!

@Hank076
Copy link
Copy Markdown
Contributor Author

Hank076 commented Mar 7, 2026

Hey @Hank076, thanks for this, you rock 😎 🙏

Could you please address the comments by @drew-simmons and me? Afterwards, I'll gladly merge this.

Thanks for the review and feedback!
I'll take a look at the comments from you and @drew-simmons and update the PR.

Hank added 2 commits March 7, 2026 11:11
`inline_file_summary` was missing from the `[pr_description]` section
in `settings/configuration.toml`. `pr_description.py:130` accesses
`get_settings().pr_description.inline_file_summary` at runtime, and
the missing key causes an exception that silently fails the describe
command.

Fixes qodo-ai#2230
@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects bot commented Mar 7, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. inline summary table mode missing 🐞 Bug ✓ Correctness
Description
inline_file_summary is documented in the default config as supporting 'table', but the code
appears to treat it only as a boolean (truthy/falsy) flag; users setting 'table' will not get
distinct behavior and may be misled about supported output formats.
Code

pr_agent/settings/configuration.toml[110]

+inline_file_summary=false # false, true, 'table'
Evidence
The default configuration explicitly advertises a 'table' mode, but the runtime logic only checks
the setting’s truthiness to decide whether to inline the walkthrough into the PR body (vs. using
file comments). No other implementation of a 'table' mode is referenced.

pr_agent/settings/configuration.toml[107-117]
pr_agent/tools/pr_description.py[125-132]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`inline_file_summary` is documented as supporting values `false`, `true`, and `&amp;#x27;table&amp;#x27;`, but the code currently uses it only in a boolean truthiness check. This makes `&amp;#x27;table&amp;#x27;` behave the same as `true` and violates the documented contract.
### Issue Context
The setting is used to decide whether the changes walkthrough is appended to the PR body vs. published as file comments. There is no code path that detects `&amp;#x27;table&amp;#x27;` and formats output differently.
### Fix Focus Areas
- pr_agent/settings/configuration.toml[107-117]
- pr_agent/tools/pr_description.py[125-132]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. Describe docs miss new knobs 🐞 Bug ✓ Correctness
Description
max_ai_calls and async_ai_calls are now present in the default [pr_description] config and are
used by large-PR handling, but the describe tool documentation does not mention them, reducing
discoverability and making tuning large-PR behavior harder.
Code

pr_agent/settings/configuration.toml[R115-117]

+enable_large_pr_handling=true
+max_ai_calls=4
+async_ai_calls=true
Evidence
The restored settings directly affect large-PR behavior: max_ai_calls controls iteration count for
chunked diff generation, and async_ai_calls controls whether multiple model calls are
parallelized. The describe tool docs list enable_large_pr_handling but do not include these
related tuning parameters.

pr_agent/settings/configuration.toml[113-117]
pr_agent/algo/pr_processing.py[260-266]
pr_agent/tools/pr_description.py[244-263]
docs/docs/tools/describe.md[132-142]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The default configuration exposes large-PR tuning parameters (`max_ai_calls`, `async_ai_calls`) that are used in runtime logic, but the describe tool documentation does not mention them.
### Issue Context
Users rely on docs to discover configuration options. These parameters control iteration count and concurrency for large PR handling.
### Fix Focus Areas
- pr_agent/settings/configuration.toml[113-117]
- docs/docs/tools/describe.md[110-151]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown

@MontaEllis8 MontaEllis8 left a comment

Choose a reason for hiding this comment

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

✅ Code Review 通过

代码审查通过,建议合并。

@PeterDaveHello
Copy link
Copy Markdown
Contributor

@naorpeled, is it possible we can go for it?

@naorpeled
Copy link
Copy Markdown
Collaborator

@naorpeled, is it possible we can go for it?

For sure 🙏

@Hank076
Copy link
Copy Markdown
Contributor Author

Hank076 commented Mar 13, 2026

Hi @naorpeled ,

The workflow is awaiting approval from a maintainer.
Could someone please approve and run the CI?

Thanks!

@qodo-ai qodo-ai deleted a comment from yiminpyang Mar 13, 2026
@qodo-ai qodo-ai deleted a comment from yiminpyang Mar 13, 2026
@naorpeled naorpeled merged commit f7b1672 into qodo-ai:main Mar 13, 2026
2 checks passed
@naorpeled
Copy link
Copy Markdown
Collaborator

Thanks @Hank076!

@PeterDaveHello
Copy link
Copy Markdown
Contributor

@naorpeled can we get a new release for this important fix? Many thanks!

@naorpeled
Copy link
Copy Markdown
Collaborator

@naorpeled can we get a new release for this important fix? Many thanks!

Hey Peter,
on it, it might take some time as the credentials reside within Qodo 🙏
(Soon this process will be easier and faster)

@PeterDaveHello
Copy link
Copy Markdown
Contributor

Thank you for releasing the new version. I tried the latest v0.33, but it seems the same issue still exists for now. It might need some further investigation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants