Skip to content

feat(review): give /review the findings of earlier reviews - #3750

Merged
IsmaelMartinez merged 9 commits into
The-PR-Agent:mainfrom
hkn-wt:feature/review-previous-findings
Oct 2, 2026
Merged

IsmaelMartinez merged 9 commits into
The-PR-Agent:mainfrom
hkn-wt:feature/review-previous-findings

Conversation

@hkn-wt

@hkn-wt hkn-wt commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Refs #3654 (the /review follow-up after #3684 and #3689).

What

The persistent review comment already stores every key issue in its pr-agent-review-state marker, as ACTIVE or RESOLVED by a later commit. The model never saw it, so it rewords a still-valid finding on every run: the finding id changes, the state treats it as new, and inline key issues get re-posted.

This renders the stored findings as a bounded JSON block (previous_findings) in the user prompt, right before the diff, where /improve puts its prior discussions:

  • Each finding is split back into the issue_header and issue_content the model emitted, plus relevant_file, lines and state. Active findings come first, then resolved ones, each newest first. An entry larger than the budget is skipped.
  • The prompt asks the model to repeat a still-valid finding word for word, changing only the lines (and the path after a rename), and to re-raise a resolved one only if the code reintroduces it. Identical text keeps key_issue_fingerprint(file, body), so both the finding state and the inline key-issue dedup match it. The hash markers stay the post-model safety net.
  • Earlier findings count toward num_max_findings; the prompt gives the slots to the most important issues, new or earlier. A full list already disables resolution, so a finding left out for lack of room stays active.
  • No new provider code: the block is built from the state _load_review_finding_state() already reads, so it works wherever supports_review_finding_state() is true (GitHub, GitLab, Azure DevOps). It is empty for incremental reviews and when no state exists, and reloaded when -i falls back to a full review.
  • _is_valid_state() now requires path and body to be strings, so a malformed marker fails closed instead of raising while rendering.

New setting pr_reviewer.max_previous_findings_chars (default 8000, 0 disables it). It is host-only in config_security.py, like max_discussion_context_chars, so a nested .pr_agent.toml cannot enlarge the prompt.

With no stored findings, both prompts render exactly as on main.

Not covered

  • Inline key-issue threads resolved by a human ("won't fix"). The state only knows bot-side resolution. That needs a key-issue thread iterator per provider, similar to _iter_code_suggestion_threads; happy to do it as a follow-up if this approach is fine.
  • The block is capped in characters (about 2k tokens), not fitted per model attempt. It is counted in TokenHandler.prompt_tokens, so the diff is packed around it, like repo_context and skills_context. Per-attempt fitting would make sense for all fixed context at once.
  • The state is read twice per run (prompt build and reconciliation), to keep the diff small.

Enabled by default because it is a no-op without stored state. If you prefer an opt-in, it is a one-line default change.

Tests

PYTHONPATH=. uv run pytest tests/unittest passes, except test_telemetry_config::test_prometheus_without_endpoint_is_not_fail_closed, which fails only because my local sandbox blocks writes to /tmp. Ruff and pre-commit pass on the touched files.

🤖 Generated with Claude Code

The persistent review comment already stores every finding and whether it is
still active or was resolved by a later commit, but the model never saw it.
It rewords a still-valid finding on every run, so the finding id changes, the
state reopens it as a new finding, and inline key issues get re-posted.

Render the stored findings as a bounded JSON block in the review prompt, split
back into issue_header and issue_content, and ask the model to repeat a
still-valid finding word for word, so the existing fingerprints match it, and
not to re-raise a resolved one unless the code reintroduces it.

New setting pr_reviewer.max_previous_findings_chars (default 8000, 0 disables
it), host-only so a nested .pr_agent.toml cannot enlarge the prompt.

Refs The-PR-Agent#3654

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Provide previous review findings to /review

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Give full reviews stored active and resolved findings so the model can preserve finding
 identities.
• Bound the prompt context with a host-controlled setting that can also disable it.
• Test context rendering and verify that repeated wording retains the same finding ID.
Diagram

graph TD
  A[("Stored Review State")] --> B["Load Prior State"] --> C["Bounded JSON"] --> D["Review Prompt"] --> E["Model Findings"] --> F["Finding Reconciliation"] --> A
  E --> G["Inline Dedup"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reuse one state snapshot per review
  • ➕ Avoids reading provider comments separately for prompt construction and reconciliation.
  • ➕ Ensures both steps see the same stored state.
  • ➖ Couples prompt preparation to reconciliation and its state/error lifecycle.
  • ➖ Expands the scope of this change.

Recommendation: Keep the PR's reuse of the existing state format and fingerprinting: it improves model context without provider changes or a new identity scheme. Consider a shared state snapshot separately if duplicate reads become costly or inconsistent.

Files changed (10) +113 / -2

Enhancement (3) +63 / -0
review_finding_state.pyRender stored findings as bounded prompt JSON +33/-0

Render stored findings as bounded prompt JSON

• Splits stored finding bodies into their original header and content, includes location and state, and prioritizes active findings before recently resolved ones. Stops adding entries when the JSON would exceed the character budget.

pr_agent/algo/review_finding_state.py

pr_reviewer_prompts.tomlGuide the model using earlier findings +12/-0

Guide the model using earlier findings

• Conditionally includes previous findings beside repository context. Instructs the model to repeat still-valid findings verbatim, re-raise resolved findings only if reintroduced, and treat stored text as untrusted data.

pr_agent/settings/pr_reviewer_prompts.toml

pr_reviewer.pyLoad previous findings into the review prompt +18/-0

Load previous findings into the review prompt

• Reads valid persistent finding state for eligible non-incremental reviews, renders it within the configured budget, and passes it to the prompt. Returns empty context when the feature is disabled or state is unavailable.

pr_agent/tools/pr_reviewer.py

Tests (3) +41 / -1
test_config_reference.pyAdjust the documented configuration-key count +1/-1

Adjust the documented configuration-key count

• Updates the expected key count to include max_previous_findings_chars.

tests/unittest/test_config_reference.py

test_pr_reviewer_finding_state.pyTest previous-findings context and stable identity +39/-0

Test previous-findings context and stable identity

• Builds active and resolved stored findings and checks their rendered JSON fields. Verifies that a repeated finding keeps its ID after line changes and that a zero budget disables the context.

tests/unittest/test_pr_reviewer_finding_state.py

test_repo_context.pyAccount for the new reviewer prompt variable +1/-0

Account for the new reviewer prompt variable

• Adds an empty previous_findings value to the expected reviewer variables when no stored context is available.

tests/unittest/test_repo_context.py

Documentation (2) +5 / -0
review.mdDocument previous-findings budget for /review +4/-0

Document previous-findings budget for /review

• Adds the setting, its default and disable value, and its dependency on persistent finding state to the review tool guide.

docs/docs/tools/review.md

configuration_reference.mdAdd the setting to the configuration reference +1/-0

Add the setting to the configuration reference

• Lists the default character budget and explains how previous findings affect subsequent reviews.

docs/docs/usage-guide/configuration_reference.md

Other (2) +4 / -1
config_security.pyProtect the prompt budget from nested configuration +1/-1

Protect the prompt budget from nested configuration

• Makes max_previous_findings_chars host-only for per-directory configuration, preventing a nested .pr_agent.toml from changing the budget.

pr_agent/config_security.py

configuration.tomlSet the default previous-findings budget +3/-0

Set the default previous-findings budget

• Adds max_previous_findings_chars with an 8000-character default and documents that zero disables the context.

pr_agent/settings/configuration.toml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 📜 Skill insights (0)

Grey Divider


Action required

1. New defects lose their review slots ✓ Resolved
Description
The new prompt rule asks the model to repeat every still-valid active finding, while
key_issues_to_review is limited to num_max_findings. When three earlier findings remain valid
under the default three-issue limit, repeating them fills the entire list even if the current
revision introduces another issue.
Code

pr_agent/settings/pr_reviewer_prompts.toml[61]

+- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same issue_header and issue_content, word for word, updating only start_line, end_line and, if the file was renamed, relevant_file: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue.
Evidence
The added instruction requires repeating still-valid active entries, while the existing output
contract caps the list at num_max_findings, whose configured default is three. Reconciliation
already treats a full list as ineligible for resolving absent findings, but it does not create an
additional slot for a new issue.

pr_agent/settings/pr_reviewer_prompts.toml[59-63]
pr_agent/settings/pr_reviewer_prompts.toml[135-135]
pr_agent/settings/configuration.toml[181-181]
pr_agent/tools/pr_reviewer.py[787-809]

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

## Issue description
Repeating all active findings can consume the entire issue limit and exclude newly introduced defects.
## Fix Focus Areas
- pr_agent/settings/pr_reviewer_prompts.toml[61-63]
- pr_agent/settings/pr_reviewer_prompts.toml[135-135]
- pr_agent/tools/pr_reviewer.py[787-809]
## Recommended Fix
Tell the model to prioritize new issues within the limit, and preserve the lifecycle state of active findings omitted solely because that limit was reached.

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



Remediation recommended

2. Renamed files get duplicate findings 🐞 Bug ≡ Correctness
Description
The new prompt tells the model to update relevant_file after a rename, but key_issue_fingerprint
includes that path even when issue_header and issue_content remain identical. When a previously
reported issue survives a rename, reconciliation creates a new active finding and either resolves or
retains the old-path record; inline deduplication also treats the new-path comment as unseen.
Code

pr_agent/settings/pr_reviewer_prompts.toml[287]

+- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same issue_header and issue_content, word for word, updating only start_line, end_line and, if the file was renamed, relevant_file: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue or its file is not in the diff below.
Evidence
The added instruction changes the reported path on rename, while both identity paths hash the file
name. Reconciliation consequently sees different IDs, and inline publication cannot recognize the
old-path fingerprint.

pr_agent/settings/pr_reviewer_prompts.toml[283-290]
pr_agent/algo/review_finding_state.py[51-66]
pr_agent/algo/review_finding_state.py[221-261]
pr_agent/algo/inline_comment_dedup.py[103-106]
pr_agent/tools/pr_reviewer.py[1384-1412]

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 prompt asks the model to update a finding’s path after a rename, but the path is part of both persistent and inline finding fingerprints. Identical wording therefore cannot match the earlier finding.
## Fix Focus Areas
- pr_agent/settings/pr_reviewer_prompts.toml[287-287]
- pr_agent/algo/review_finding_state.py[51-66]
- pr_agent/algo/inline_comment_dedup.py[103-106]
- pr_agent/tools/pr_reviewer.py[1384-1412]
## Recommended Fix
Use the provider’s file-rename information to associate old and new paths before reconciling finding IDs and checking inline fingerprints. Preserve the earlier identity for a finding whose path changed solely because of a rename.

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


3. Fixed issues can stay active in chunked reviews ✓ Resolved
Description
previous_findings is included in every chunk’s prompt, so a chunk that does not contain the
affected file can repeat an active finding even when the chunk containing that file omits it as
fixed. When that happens, the chunk merger retains the repeated issue and reconciliation treats it
as present, preventing its resolution.
Code

pr_agent/tools/pr_reviewer.py[245]

+            "previous_findings": previous_findings,
Evidence
The new variable is shared across model calls, while _get_prediction copies the same variables for
each chunk. The prompt asks for active findings to be repeated; the merger unions reported key
issues, and reconciliation keeps any reported finding active regardless of which chunk reported it.

pr_agent/tools/pr_reviewer.py[242-245]
pr_agent/tools/pr_reviewer.py[1100-1103]
pr_agent/settings/pr_reviewer_prompts.toml[283-290]
pr_agent/algo/review_merge.py[38-61]
pr_agent/algo/review_finding_state.py[245-283]

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

## Issue description
Chunked reviews give every model call the same previous findings, including findings for files absent from that chunk. A repetition from an unrelated chunk can keep a fixed finding active after the relevant chunk omits it.
## Fix Focus Areas
- pr_agent/tools/pr_reviewer.py[245-245]
- pr_agent/tools/pr_reviewer.py[1060-1105]
- pr_agent/algo/review_merge.py[191-208]
## Recommended Fix
Provide each chunk only prior findings whose files it covers, and account for the resulting context when fitting that chunk’s prompt. Ensure an unrelated chunk cannot contribute a prior finding to the merged result.

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


4. Reintroduced defects retain stale history ✓ Resolved
Description
The prompt requires verbatim wording for active findings but gives no such instruction for resolved
findings that the model reports again. If the model rephrases a reintroduced defect, reconciliation
assigns it a new identity and leaves the original record resolved, so the review can show both an
active finding and its stale resolved copy.
Code

pr_agent/settings/pr_reviewer_prompts.toml[288]

+- "resolved": a later commit fixed it. Report it again only if the current code reintroduces it.
Evidence
The new prompt explicitly requires identical text for active findings but not for resolved ones.
Finding identity hashes the normalized path and body; reconciliation reopens a resolved record only
when its identity matches, otherwise it creates an active record and retains the old resolved
record, which is rendered in the resolved section.

pr_agent/settings/pr_reviewer_prompts.toml[287-289]
pr_agent/algo/review_finding_state.py[45-56]
pr_agent/algo/review_finding_state.py[247-283]
pr_agent/algo/review_finding_state.py[339-362]

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 resolved-finding instruction permits a reintroduced issue to be rephrased, which creates a new finding identity instead of reopening its stored record.
## Fix Focus Areas
- pr_agent/settings/pr_reviewer_prompts.toml[287-289]
## Recommended Fix
Tell the model to reuse the stored issue_header and issue_content word for word when reporting a reintroduced resolved finding, while updating its location as needed.

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


View medium (10)
5. One async fallback test lacks its marker ✓ Resolved
Description
test_incremental_fallback_to_full_review_loads_previous_findings is declared async def without
@pytest.mark.asyncio, unlike the surrounding async review tests. When collected, it relies on the
repository's automatic asyncio mode rather than carrying the explicit marker used elsewhere in this
module.
Code

tests/unittest/test_pr_reviewer_finding_state.py[1607]

+async def test_incremental_fallback_to_full_review_loads_previous_findings(monkeypatch):
Evidence
The checklist requires an explicit asyncio decorator on async pytest tests. The newly added test at
line 1607 has no decorator, while existing async tests in the same module use
@pytest.mark.asyncio.

Rule 2982393: Decorate async pytest tests with @pytest.mark.asyncio
tests/unittest/test_pr_reviewer_finding_state.py[1607-1618]
tests/unittest/test_pr_reviewer_finding_state.py[773-774]

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 new async fallback test lacks the explicit pytest marker required for async tests.
## Fix Focus Areas
- tests/unittest/test_pr_reviewer_finding_state.py[1607-1607]
## Recommended Fix
Add `@pytest.mark.asyncio` directly above the test, matching the other async tests in the module.

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


6. Past review text can steer later reviews ✓ Resolved
Description
render_previous_findings puts persisted issue_content into previous_findings, which the
template inserts verbatim into the system prompt. If an earlier review echoes instructions from
untrusted pull-request content into a finding, those instructions return on later runs at
system-prompt priority rather than alongside the diff in the user prompt.
Code

pr_agent/settings/pr_reviewer_prompts.toml[R57-60]

+Findings from earlier reviews of this PR (JSON data):
+======
+{{ previous_findings|trim }}
+======
Evidence
Model-produced issue text becomes the persisted finding body; the new renderer extracts that body
into JSON without removing natural-language instructions. The template inserts the JSON in its
system section, whereas the reviewed diff is interpolated in the user section. The added warning
identifies the data as untrusted but does not change its message priority.

pr_agent/tools/pr_reviewer.py[663-682]
pr_agent/algo/review_finding_state.py[322-335]
pr_agent/settings/pr_reviewer_prompts.toml[54-64]
pr_agent/settings/pr_reviewer_prompts.toml[295-295]
pr_agent/tools/pr_reviewer.py[1060-1081]

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

## Issue description
Stored finding text can contain instructions derived from untrusted pull-request content and is now interpolated into the system prompt on later reviews.
## Fix Focus Areas
- pr_agent/settings/pr_reviewer_prompts.toml[54-64]
- pr_agent/algo/review_finding_state.py[322-336]
## Recommended Fix
Keep the behavioral rules in the system prompt, but pass the serialized finding history as explicitly untrusted data in the lower-priority user prompt rather than interpolating its contents into system instructions.

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


7. Malformed history stops a new review ✓ Resolved
Description
render_previous_findings() passes finding["body"] to a regular expression even though
_is_valid_state() accepts any truthy value for that field. If a persistent review marker contains
a non-string body, state parsing accepts it and reviewer initialization raises TypeError while
building the prompt.
Code

pr_agent/algo/review_finding_state.py[320]

+        match = _FINDING_HEADER_RE.fullmatch(finding["body"])
Evidence
The checklist requires earlier findings to remain available to the feature. State validation checks
that the body is truthy but not that it is a string; the new rendering call requires a string, and
reviewer initialization calls that rendering path.

Collect earlier bot findings and thread status
pr_agent/algo/review_finding_state.py[108-115]
pr_agent/algo/review_finding_state.py[319-320]
pr_agent/tools/pr_reviewer.py[204-207]

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

## Issue description
A non-string body in a persisted finding passes state validation but crashes prompt rendering.
## Fix Focus Areas
- pr_agent/algo/review_finding_state.py[108-115]
- pr_agent/algo/review_finding_state.py[319-327]
## Recommended Fix
Require string paths and bodies during state validation, and add a test confirming that an invalid marker cannot crash review initialization.

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


8. A fallback comment uses narrative prose ✓ Resolved
Description
The new comment in run() describes what the fallback full review can do rather than phrasing the
step as an instruction. It accompanies the branch that reloads findings after incremental mode is
disabled, so it describes the newly added behavior.
Code

pr_agent/tools/pr_reviewer.py[297]

+                    # The fallback full review can use the findings the incremental mode left out.
Evidence
The checklist requires behavioral comments to use imperative phrasing. The added comment begins `The
fallback full review can use`, which narrates the branch rather than instructing its action.

Rule 2694688: Docstrings and comments must use imperative phrasing
pr_agent/tools/pr_reviewer.py[296-299]

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 new fallback-branch comment narrates behavior rather than using imperative phrasing.
## Fix Focus Areas
- pr_agent/tools/pr_reviewer.py[297-297]
## Recommended Fix
Rephrase the comment as an instruction to reload earlier findings for the full-review fallback.

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


9. Stored findings can prevent a review ✓ Resolved
Description
previous_findings is added to the fixed prompt under a character limit, but it is not reduced when
the selected model has too little token capacity. If the stored context pushes the prompt over that
limit, fitting the diff fails even with an empty diff, and splitting the diff into chunks cannot
make the review fit.
Code

pr_agent/tools/pr_reviewer.py[245]

+            "previous_findings": previous_findings,
Evidence
The renderer limits JSON by characters, and the new variable places it in the fixed prompt. The
prediction path fits only diff; the token-budget fitter raises when the prompt with that field
empty already exceeds the model limit. Every chunk uses the same fixed prompt.

pr_agent/algo/review_finding_state.py[305-334]
pr_agent/tools/pr_reviewer.py[242-245]
pr_agent/tools/pr_reviewer.py[1069-1081]
pr_agent/algo/token_budget.py[548-559]

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

## Issue description
Stored findings have a character cap but no model-token cap, so they can make the fixed review prompt too large before any diff is fitted.
## Fix Focus Areas
- pr_agent/tools/pr_reviewer.py[245-245]
- pr_agent/tools/pr_reviewer.py[829-845]
- pr_agent/algo/review_finding_state.py[305-334]
## Recommended Fix
Fit or omit previous-finding entries against each model attempt’s token budget, reserving capacity for the diff before constructing the final prompt.

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


10. Recent active findings can lose context ✓ Resolved
Description
render_previous_findings() takes active findings in stored order, which is sorted by finding
fingerprint rather than recency. When active entries exceed max_previous_findings_chars, an older
entry can occupy the budget ahead of a recent one, leaving the recent wording unavailable for the
next review’s deduplication.
Code

pr_agent/algo/review_finding_state.py[R315-319]

+    active = [finding for finding in findings if finding.get("state") == "ACTIVE"]
+    resolved = [finding for finding in findings if finding.get("state") == "RESOLVED"]
+    resolved.sort(key=lambda finding: str(finding.get("resolved_at") or ""), reverse=True)
+    entries, context = [], ""
+    for finding in active + resolved:
Evidence
Reconciliation records last_seen, but _retained_findings stores all findings sorted by
finding_id. The new renderer preserves that order for active entries and admits entries until the
character budget is exhausted, so selection does not favor recent active findings.

pr_agent/algo/review_finding_state.py[180-198]
pr_agent/algo/review_finding_state.py[224-240]
pr_agent/algo/review_finding_state.py[314-334]

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

## Issue description
Active findings inherit fingerprint order, so the bounded context can omit newer active findings while retaining older ones.
## Fix Focus Areas
- pr_agent/algo/review_finding_state.py[315-319]
- pr_agent/algo/review_finding_state.py[329-334]
## Recommended Fix
Sort active findings by `last_seen` descending before applying the character budget, with a deterministic tie-breaker.

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


11. A new test comment uses narrative prose ✓ Resolved
Description
The comment above the finding-identity assertion says `Repeating the header and content verbatim
keeps the finding id` rather than phrasing the test step as an instruction. It accompanies the new
previous-findings test, where the assertion already demonstrates the relationship the comment
describes.
Code

tests/unittest/test_pr_reviewer_finding_state.py[1581]

+    # Repeating the header and content verbatim keeps the finding id, so the state and inline dedup match it.
Evidence
The checklist requires behavior-describing comments to use imperative phrasing. The added comment
begins with Repeating and states what happens rather than instructing the reader.

Rule 2694688: Docstrings and comments must use imperative phrasing
tests/unittest/test_pr_reviewer_finding_state.py[1581-1581]

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 new test comment describes behavior in narrative prose rather than using an imperative instruction.
## Fix Focus Areas
- tests/unittest/test_pr_reviewer_finding_state.py[1581-1581]
## Recommended Fix
Rephrase the comment as an instruction, such as `Check that repeating the header and content preserves the finding ID`, or remove it if the assertion is sufficiently clear.

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


12. Full fallback reviews miss prior findings ✓ Resolved
Description
PRReviewer.__init__ loads previous_findings while an -i request is still marked incremental,
so _review_finding_state_enabled() makes the stored context empty. If
_can_run_incremental_review() later finds no commit range, it switches to a full review without
rebuilding that prompt value.
Code

pr_agent/tools/pr_reviewer.py[207]

+        previous_findings = self._load_previous_findings_context()
Evidence
Incremental mode is set before the new load; the state gate excludes incremental reviews, while the
run gate can subsequently disable incremental mode and continue as a full review. The prompt uses
the value already stored in self.vars.

pr_agent/tools/pr_reviewer.py[183-188]
pr_agent/tools/pr_reviewer.py[204-245]
pr_agent/tools/pr_reviewer.py[280-287]
pr_agent/tools/pr_reviewer.py[489-503]
pr_agent/tools/pr_reviewer.py[638-651]
pr_agent/tools/pr_reviewer.py[1474-1480]

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

## Issue description
An incremental request that falls back to a full review retains the empty prior-findings context computed during construction.
## Fix Focus Areas
- pr_agent/tools/pr_reviewer.py[204-207]
- pr_agent/tools/pr_reviewer.py[280-287]
- pr_agent/tools/pr_reviewer.py[1474-1480]
## Recommended Fix
Populate or refresh `previous_findings` after the incremental-review gate has determined the mode, before preparing the model prompt.

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


13. Renamed files lose their inline findings ✓ Resolved
Description
The new prompt rule tells the model to retain an active finding’s relevant_file word for word,
even when that file has been renamed. When the old path is absent from the current diff, inline
publication rejects the finding while reconciliation can keep it active under that stale path.
Code

pr_agent/settings/pr_reviewer_prompts.toml[61]

+- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same relevant_file, issue_header and issue_content, word for word, updating only start_line and end_line: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue.
Evidence
The instruction requires the old path, but inline preparation matches finding paths against current
diff filenames and rejects an absent path. State normalization and reconciliation use the supplied
path without checking that it still exists in the diff.

pr_agent/settings/pr_reviewer_prompts.toml[57-63]
pr_agent/tools/pr_reviewer.py[1292-1301]
pr_agent/tools/pr_reviewer.py[1349-1364]
pr_agent/algo/review_finding_state.py[48-74]
pr_agent/algo/review_finding_state.py[242-267]

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

## Issue description
Copying a prior finding's file path after a rename makes its location invalid for inline publication.
## Fix Focus Areas
- pr_agent/settings/pr_reviewer_prompts.toml[61-62]
- pr_agent/tools/pr_reviewer.py[1292-1301]
## Recommended Fix
Permit the model to update `relevant_file` when the same code has moved, and handle the resulting path change during finding reconciliation rather than requiring a stale path.

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


14. A long finding hides other prior issues ✓ Resolved
Description
render_previous_findings() stops iterating when an entry would exceed max_chars, rather than
trying subsequent entries. If the first active finding exceeds the budget by itself, the context is
empty even when smaller stored findings would fit.
Code

pr_agent/algo/review_finding_state.py[R329-331]

+        candidate = json.dumps(entries + [entry], ensure_ascii=False, indent=2)
+        if len(candidate) > max_chars:
+            break
Evidence
Stored finding bodies have no length limit in normalization or state validation. Rendering returns
the initially empty context immediately after the first oversized candidate triggers break,
without testing later entries.

pr_agent/algo/review_finding_state.py[48-58]
pr_agent/algo/review_finding_state.py[98-117]
pr_agent/algo/review_finding_state.py[314-334]

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

## Issue description
A single oversized stored finding prevents every later, smaller finding from reaching the review prompt.
## Fix Focus Areas
- pr_agent/algo/review_finding_state.py[319-334]
## Recommended Fix
When a candidate exceeds the character budget, skip that entry and continue checking the remaining findings against the available budget.

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


  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

- Reload previous findings when an incremental request falls back to a full
  review, and rebuild the token handler so the prompt size stays accurate.
- Skip a stored finding larger than the budget instead of dropping every
  finding after it.
- Let the model update relevant_file when the file was renamed, so the
  finding stays publishable inline.
- Drop a test comment the assertion already states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit c09c6d5

…ering

- Treat a stored finding whose path or body is not a string as an invalid
  state marker, so it fails closed instead of raising while the prompt or the
  resolved section is rendered.
- Offer the most recently seen active findings first when the budget cannot
  hold them all.
- Phrase the fallback comment as an instruction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 62d2d9f

Tell the model that repeated findings count toward num_max_findings and that
the slots go to the most important issues, new or earlier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit e1fd5db

Stored finding text comes from earlier model output, which can quote the
diff, so it should not reach the system prompt. Render the block in the user
prompt next to the diff, as /improve does for its prior discussions. With no
stored findings, both prompts render exactly as before.

Also mark the async fallback test with pytest.mark.asyncio, like the other
async tests in the module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 4362fd0

A resolved finding reported again in new words got a new identity, so the
review showed it both as active and in the resolved section. Ask for the
stored issue_header and issue_content word for word, as for active findings,
so reconciliation reopens the stored record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit d2f2763

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for building the /review half of #3654 on the existing state marker, with no provider code and no extra model call. Without stored state the prompt is unchanged, and the fallback reload is covered. Four inline suggestions: a prompt clause for chunked reviews (Qodo's point 2), dropping an unused TokenHandler rebuild with its test (please commit those two together, since the test fails with either one alone), and autoescape=True in the new prompt test, which clears the two CodeQL alerts failing the check.

======
{{ previous_findings|trim }}
======
- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same issue_header and issue_content, word for word, updating only start_line, end_line and, if the file was renamed, relevant_file: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same issue_header and issue_content, word for word, updating only start_line, end_line and, if the file was renamed, relevant_file: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue.
- "active": reported by the latest review. If the issue still exists in the current code, report it again with the same issue_header and issue_content, word for word, updating only start_line, end_line and, if the file was renamed, relevant_file: identical text lets PR-Agent recognize it as the same finding. Leave it out if the code no longer has the issue or its file is not in the diff below.

With chunking every chunk sees the whole block, so a chunk without the file can repeat a fixed finding and keep it active (Qodo's point 2). Telling the model to skip findings for files outside its diff addresses that, and a truncated diff already skips resolution.

Comment thread pr_agent/tools/pr_reviewer.py Outdated
Comment on lines +298 to +304
self.vars["previous_findings"] = self._load_previous_findings_context()
self.token_handler = TokenHandler(
self.git_provider.pr,
self.vars,
get_settings().pr_review_prompt.system,
get_settings().pr_review_prompt.user
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
self.vars["previous_findings"] = self._load_previous_findings_context()
self.token_handler = TokenHandler(
self.git_provider.pr,
self.vars,
get_settings().pr_review_prompt.system,
get_settings().pr_review_prompt.user
)
self.vars["previous_findings"] = self._load_previous_findings_context()

_prepare_prediction rebuilds the token handler from _raw_prompt_vars on every attempt, and that copy is taken after this reload, so this handler is never read.

Comment on lines +1617 to +1624
token_handler = MagicMock()
monkeypatch.setattr("pr_agent.tools.pr_reviewer.TokenHandler", token_handler)
_patch_run_dependencies(monkeypatch, reviewer)

await reviewer.run()

assert reviewer.incremental.is_incremental is False
assert token_handler.call_args.args[1]["previous_findings"] == "[stored findings]"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
token_handler = MagicMock()
monkeypatch.setattr("pr_agent.tools.pr_reviewer.TokenHandler", token_handler)
_patch_run_dependencies(monkeypatch, reviewer)
await reviewer.run()
assert reviewer.incremental.is_incremental is False
assert token_handler.call_args.args[1]["previous_findings"] == "[stored findings]"
_patch_run_dependencies(monkeypatch, reviewer)
await reviewer.run()
assert reviewer.incremental.is_incremental is False
assert reviewer._raw_prompt_vars["previous_findings"] == "[stored findings]"

This asserts on the vars the prompt is actually built from, and it still fails if the reload is removed.

Comment on lines +1643 to +1644
assert "stored finding" not in Environment().from_string(prompts.system).render(variables)
assert "stored finding" in Environment().from_string(prompts.user).render(variables)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert "stored finding" not in Environment().from_string(prompts.system).render(variables)
assert "stored finding" in Environment().from_string(prompts.user).render(variables)
assert "stored finding" not in Environment(autoescape=True).from_string(prompts.system).render(variables)
assert "stored finding" in Environment(autoescape=True).from_string(prompts.user).render(variables)

Matches the other prompt tests and clears CodeQL's autoescape alerts; both assertions still hold.

- Tell the model to leave out an active finding whose file is not in its diff,
  so a chunk without that file cannot keep a fixed finding active.
- Drop previous_findings for a model attempt whose budget cannot hold them,
  instead of failing the review; the raw vars keep them for the next model.
- Remove the unused TokenHandler rebuild in the -i fallback and assert on the
  prompt vars instead.
- Render the prompt test with autoescape=True.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 9e9f6cc

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking all four suggestions as they were and for adding the per-model fallback, so a tight budget now drops the earlier findings instead of failing the review. One thing is left: #3743 added a config key on main, so once this merges the key-count test fails (suggestion inline). Qodo's rename point is not something this PR introduces: on main the path is already part of a finding's identity, so rename-aware matching is a separate change.

Comment thread tests/unittest/test_config_reference.py Outdated
def test_config_reference_covers_every_active_key():
keys = _toml_keys(CONFIG_TOML.read_text(encoding="utf-8"))
assert sum(keys.values()) == 272
assert sum(keys.values()) == 273

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert sum(keys.values()) == 273
assert sum(keys.values()) == 274

With max_previous_findings_chars plus the key #3743 added on main, the merged config has 274 keys, so please merge main in along with this.

hkn-wt and others added 2 commits October 2, 2026 17:16
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 14e8d85

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for merging main in and counting the new key; approving and merging.

@IsmaelMartinez
IsmaelMartinez merged commit d999118 into The-PR-Agent:main Oct 2, 2026
11 checks passed
pdecat pushed a commit to pdecat/pr-agent that referenced this pull request Oct 15, 2026
…ent#3750)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d999118)
depohmel added a commit to depohmel/pr-agent that referenced this pull request Oct 16, 2026
* perf(diff): skip fuzzy matching for exact patch lines (The-PR-Agent#3725)

* fix(improve): match applied entries when capping history (The-PR-Agent#3735)

* fix(gerrit): reject unsupported reflect webhook action (The-PR-Agent#3748)

* fix(gitlab): stop search_line from raising UnboundLocalError (The-PR-Agent#3756)

* fix(github_action): fail the Action when a tool records a swallowed failure (The-PR-Agent#3712)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(azure): do not resolve a comment thread after a swallowed tool failure (The-PR-Agent#3722)

* refactor(git-providers): share code suggestion publishing (The-PR-Agent#3726)

* fix(github): fetch all direct sub-issues (The-PR-Agent#3746)

* fix(github): invalidate stale non-empty diff caches (The-PR-Agent#3724)

* docs(github): clarify fork PR checkout and token behavior (The-PR-Agent#3691)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: fail closed on three silent fallbacks (The-PR-Agent#3742)

Co-authored-by: Ismael Martinez Ramos <ismael.martinez@postcodelottery.co.uk>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(gitea): delete every temp comment on cleanup (The-PR-Agent#3765)

* perf(gitlab): skip impossible file content reads (The-PR-Agent#3761)

* chore: clean up LiteLLM compatibility notes for future upgrades (The-PR-Agent#3764)

* perf(tokens): avoid redundant initial prompt counting (The-PR-Agent#3762)

* perf(diff): stop stalled large-PR packing (The-PR-Agent#3763)

* fix: detect language for multi-part and uppercase suffixes (The-PR-Agent#3767)

* fix(tickets): preserve branch issue order (The-PR-Agent#3766)

* fix(codecommit): prepare comment bodies in publish_code_suggestions (The-PR-Agent#3736)

Co-authored-by: Abreham Melese <xvimelese@gmail.com>

* fix(bitbucket): apply ignore filters to push commands (The-PR-Agent#3768)

Co-authored-by: qyy <qyy@8023.com>

* fix(servers): require a leading slash for comment commands (The-PR-Agent#3769)

Co-authored-by: qyy <qyy@8023.com>

* docs: add kapa.ai "Ask AI" widget (The-PR-Agent#3777)

* fix(mosaico): honor streaming requirements in health probes (The-PR-Agent#3781)

* fix(azure): apply ignore patterns to slash-prefixed paths (The-PR-Agent#3770)

* feat(gitlab): distinguish applied and bot-resolved suggestion threads in the improve context (The-PR-Agent#3774)

* fix(changelog): preserve concurrent edits during changelog updates (The-PR-Agent#3751)

Co-authored-by: Ismael Martinez <430992+IsmaelMartinez@users.noreply.github.com>

* fix: preserve findings when inline positions cannot be resolved (The-PR-Agent#3753)

* fix: stop three silent fallbacks that corrupt review and label output (The-PR-Agent#3744)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(bitbucket): reject incomplete aggregate pull request diffs (The-PR-Agent#3743)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Ismael Martinez <430992+IsmaelMartinez@users.noreply.github.com>

* fix(gitlab): classify concurrent changelog creation (The-PR-Agent#3786)

* fix(changelog): make fence stripping idempotent (The-PR-Agent#3783)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(providers): encode filenames in line links (The-PR-Agent#3782)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>
Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* fix(tokens): drop dangling bytes when fitting truncated prompt text (The-PR-Agent#3771)

* chore: fix ruff rule E402 B027 (The-PR-Agent#3772)

Co-authored-by: even-even <>
Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(labels): build the label enum when no custom labels are set (The-PR-Agent#3773)

* fix(github): fetch newest polling comments (The-PR-Agent#3747)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>
Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* fix(action): share GitHub helpers so the Action keeps the The-PR-Agent#3670 /ask fix (The-PR-Agent#3785)

* fix(typo): commitable to committable (The-PR-Agent#3749)

Co-authored-by: even-even <>

* fix: stop caching repo context on a mutable ref (The-PR-Agent#3776)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(review): link a TODO without a usable line number to its file (The-PR-Agent#3788)

Co-authored-by: Arta Shoja <arta.shoja@postcode-lotterie.de>

* chore(docs): remove unused direct clsx dependency (The-PR-Agent#3789)

* chore(docs): apply security patches with `npm audit fix` (The-PR-Agent#3790)

* chore: remove redundant CLAUDE.md pointer file (The-PR-Agent#3760)

* fix(servers): route inline comments to /ask_line only on a leading /ask (The-PR-Agent#3797)

* fix(bitbucket): encode filenames in line links (The-PR-Agent#3796)

* fix(tools): re-raise any provider incomplete-files error, not just Bitbucket's (The-PR-Agent#3800)

* fix(models): clamp OpenRouter Gemini reasoning disablement (The-PR-Agent#3787)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>
Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(tickets): cap fetched sub-issues per ticket and order parent before children (The-PR-Agent#3807)

* chore(deps): bump PyJWT from 2.13.0 to 2.15.1 for security fixes (The-PR-Agent#3805)

* chore(deps): address urllib3 and virtualenv security advisories (The-PR-Agent#3804)

* chore: remove unused date and inline-comment helpers (The-PR-Agent#3803)

* fix(git_providers): log publish and settings errors at quiet verbosity (The-PR-Agent#3802)

* chore(release): bump version to 0.47.0 [skip ci]

* feat(review): give /review the findings of earlier reviews (The-PR-Agent#3750)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix: include filtered changed filenames in review context (The-PR-Agent#3806)

Co-authored-by: truongnq <truongnq@local.com>

* fix(file_filter): report skipped and incomplete ignore filtering (The-PR-Agent#3801)

* docs(config): align self-review knobs with the visual-marker-only note (The-PR-Agent#3809)

* fix(deps): declare urllib3 as a direct dependency (The-PR-Agent#3811)

* chore(deps): bump oauthlib to 4.0.0 in uv.lock (The-PR-Agent#3812)

* refactor: remove redundant work from output processing (The-PR-Agent#3813)

* fix(gitea): use the shared slash-command comment gate (The-PR-Agent#3784)

* refactor(prompt): standardize on sandboxed Jinja (The-PR-Agent#3819)

* fix(bitbucket): summarize sensitive webhook payload logs (The-PR-Agent#3818)

* feat: report chunk progress in the progress comment (The-PR-Agent#3814)

* fix(gitea): anchor code suggestions to the new file (The-PR-Agent#3821)

* fix(local): return the branch name string from get_pr_branch (The-PR-Agent#3841)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(gerrit): validate refspec before fetching (The-PR-Agent#3838)

* docs: self-host README images (The-PR-Agent#3839)

* fix(litellm): scope bedrock model_id per model, fix fallback region lookup (The-PR-Agent#3846)

* fix(github): reject file lists collected across PR revisions (The-PR-Agent#3848)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>

* fix(changelog): preserve confirmed writes after feedback failure (The-PR-Agent#3849)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>

* fix(gitlab): report suggestion publication failures (The-PR-Agent#3129)

Signed-off-by: teachershuang <guhongkaiailaopo@gmail.com>

* fix(litellm): skip same-model retry on length truncation (The-PR-Agent#3827)

* fix(webhooks): cap request bodies before parsing (The-PR-Agent#3820)

* fix(improve): make the reflection-failure score configurable (The-PR-Agent#3833)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(models): add OpenAI GPT-6 Sol and Luna support (The-PR-Agent#3628)

* perf(gitlab): stop fetching the project and merge request to react (The-PR-Agent#3851)

* perf(gitlab): read the default branch once instead of per read (The-PR-Agent#3853)

* chore: unskip B017 ruff rule (The-PR-Agent#3856)

Co-authored-by: even-even <>

* perf(yaml): use LibYAML for initial response parsing (The-PR-Agent#3759)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(servers): match the whole /ask command token (The-PR-Agent#3822)

* feat(otel): export per-command token usage (The-PR-Agent#3835)

* fix(security): keep provider endpoints host controlled (The-PR-Agent#3840)

* fix(gitlab): refill ticket context after failed issue lookups (The-PR-Agent#3859)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>

* fix(improve): report unconfirmed persistent suggestion updates (The-PR-Agent#3858)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>

* fix(litellm): treat Bedrock ARN overrides as Claude for caching and cost (The-PR-Agent#3844)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: close LiteLLM streams without interrupting cancellation (The-PR-Agent#3723)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(ask): require https and bound redirects in image check (The-PR-Agent#3847)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(outputs): separate sink strategies from dispatch (The-PR-Agent#3854)

* feat(gitlab): react to how a comment command ended (The-PR-Agent#3852)

* feat(local): support repo context files in the local git provider (The-PR-Agent#3863)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(gitea): reject incomplete changed-file inventories (The-PR-Agent#3857)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(ask): sanitize echoed question and line-question answers against quick actions (The-PR-Agent#2629) (The-PR-Agent#3860)

* refactor: make provider SDKs optional (The-PR-Agent#3679)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(improve): name deleted files instead of sending their lines (The-PR-Agent#3866)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(local): write description.md as UTF-8 (The-PR-Agent#3874)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(plain-diff): keep output when stdout cannot encode it (The-PR-Agent#3875)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(push-outputs): add Telegram channel (The-PR-Agent#3868)

* fix(git-providers): prevent fork changelog writes (The-PR-Agent#3905)

Co-authored-by: nightcityblade <nightcityblade@gmail.com>

* fix(gitlab): authorize submodule diff targets (The-PR-Agent#3897)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(litellm): isolate request settings (The-PR-Agent#3898)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(config): require config.global_settings_repo for namespace settings (The-PR-Agent#3908)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(commands): Honor disabled publication in line questions and help (The-PR-Agent#3900)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* feat(describe): report chunk progress in the progress comment (The-PR-Agent#3872)

* fix: restrict generated labels to the enabled vocabulary (The-PR-Agent#3899)

Co-authored-by: Amazing <77201076+black-fruit@users.noreply.github.com>

* fix: propagate recorded tool failures from CLI (The-PR-Agent#3919)

* ci: scope docs-ci write to the deploy job and default the other workflows to read-only (The-PR-Agent#3896)

Signed-off-by: Yunare Maia <yunare@gmail.com>
Co-authored-by: yunaremaia <41013139+yunaremaia@users.noreply.github.com>

* fix(mosaico): limit requests and isolate caller tasks (The-PR-Agent#3926)

* fix(servers): verify Gitea and GitLab webhooks before parsing (The-PR-Agent#3912)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: preserve optional provider install hints in context errors (The-PR-Agent#3929)

Co-authored-by: strawberry-little-bear <strawberry-little-bear@users.noreply.github.com>

* fix(ignore): allow globstar segments to match zero directories (The-PR-Agent#3855)

* fix(telemetry): configure delta aggregation temporality for prometheus counter exporter (The-PR-Agent#3871) (The-PR-Agent#3873)

* fix(review): mark PR title/description/commits/tickets/code as untrusted in reviewer system prompt (The-PR-Agent#3921)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(gitea): skip the base-content fetch for added files (The-PR-Agent#3936)

* chore(deps): update LiteLLM to 1.104.0 (The-PR-Agent#3932)

* fix(gitea): parse PR and issue URLs of an instance served under a subpath (The-PR-Agent#3937)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(tickets): Match full issue URLs on the configured GitHub origin (The-PR-Agent#3907)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* feat(models): add OpenAI GPT-6.1 Sol support (The-PR-Agent#3938)

* fix(gerrit): keep line endings and mode when applying a suggestion (The-PR-Agent#3876)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix: restrict host-only comment arguments (The-PR-Agent#3902)

Co-authored-by: nightcityblade <nightcityblade@gmail.com>

* perf(git_providers): memoize get_languages() across providers (The-PR-Agent#3934)

* fix(git_providers): bound HTTP requests that have no timeout (The-PR-Agent#3850)

* fix(docker): Run services as non-root and pin build images (The-PR-Agent#3910)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* fix(gitlab): Verify stored webhook tokens before loading credentials (The-PR-Agent#3913)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(tickets): restrict GitHub issue reads to approved repositories (The-PR-Agent#3922)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix: load repository settings from target refs (The-PR-Agent#3906)

Co-authored-by: nightcityblade <nightcityblade@gmail.com>

* fix(webhooks): Require Azure and Bitbucket Server credentials (The-PR-Agent#3911)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(ci): bump the actions-minor-and-patch group with 2 updates (The-PR-Agent#3940)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(config): stop loading [tool.pr-agent] from the checkout's pyproject.toml (The-PR-Agent#3941)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs: narrow installation permissions (The-PR-Agent#3901)

Co-authored-by: nightcityblade <nightcityblade@gmail.com>

* fix(security): protect provider connection settings (The-PR-Agent#3904)

Co-authored-by: nightcityblade <nightcityblade@gmail.com>

* feat(github): stream chunk progress into in-progress check runs (The-PR-Agent#3933)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(deps): bump proxy-addr from 2.0.7 to 2.0.8 in /docs (The-PR-Agent#3946)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump source-map-js in /docs and make the uv pin a floor for Dependabot (The-PR-Agent#3949)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(deps): bump fsspec from 2025.12.0 to 2026.6.0 (The-PR-Agent#3953)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump langgraph-sdk from 0.4.2 to 0.4.4 (The-PR-Agent#3952)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump multidict from 6.7.1 to 6.9.1 (The-PR-Agent#3954)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(review): treat human-resolved inline key-issue threads as dismissed (The-PR-Agent#3925)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(bitbucket): align Connect lifecycle and JWT handling (The-PR-Agent#3877) (The-PR-Agent#3923)

Co-authored-by: Ankita-Advitot <ankita.advitot@joshsoftware.com>

* fix(security): reject dunder section/key names in repo settings files (The-PR-Agent#3947)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* chore(deps): bump shell-quote from 1.10.0 to 1.12.0 in /docs (The-PR-Agent#3957)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(diff): use fixed context for headerless hunks (The-PR-Agent#3955)

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix: keep provider auth and TLS settings host-only (The-PR-Agent#3950)

Co-authored-by: insisong <emmanuelisaacnsisong@gmail.com>

* fix(local): respect the configured description token budget (The-PR-Agent#3956)

* chore: unskip B904 ruff rule (The-PR-Agent#3951)

Co-authored-by: even-even <>
Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(context): avoid duplicate local repository context entries (The-PR-Agent#3968)

* fix(diff): extend zero-length hunks from the right line in extend_patch (The-PR-Agent#3966)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(polling): preserve pulls segment in comment URLs (The-PR-Agent#3962)

* fix(bitbucket): handle push events without a pull request (The-PR-Agent#3961)

* fix(gitea): read diff file names with the shared parser (The-PR-Agent#3964)

* fix: enforce PR ignore policy at the agent boundary (The-PR-Agent#3943)

* fix(review): handle non-list can_be_split values (The-PR-Agent#3969)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(review): log all schema validation errors and run require checks (The-PR-Agent#3973) (The-PR-Agent#3974)

Co-authored-by: Ankita-Advitot <ankita.advitot@joshsoftware.com>

* chore: unskip B023 ruff rule (The-PR-Agent#3977)

Co-authored-by: even-even <>

* fix(gitea): reuse the PR commit snapshot for messages (The-PR-Agent#3971)

* fix(ask): propagate final reply delivery errors (The-PR-Agent#3970)

* fix(context): prioritize directly linked ticket context (The-PR-Agent#3967)

* fix(bitbucket): verify the webhook JWT before parsing the request body (The-PR-Agent#3958)

* feat(tickets): include native issue references from PR titles (The-PR-Agent#3980)

* perf(diff): reuse patch token counts across packing rounds (The-PR-Agent#3986)

* perf(context): load instruction files lazily by line budget (The-PR-Agent#3985)

* fix(litellm): align OpenRouter reasoning clamps and token reserves (The-PR-Agent#3981)

* fix(github): resolve threads for replies after the first comment page (The-PR-Agent#3979)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* fix: preserve extra instructions in suggestion reflection (The-PR-Agent#3987)

* fix: mark CI artifact input as untrusted (The-PR-Agent#3978)

Signed-off-by: 张峻祎 <zhangjunyi20130307@163.com>
Signed-off-by: NekoPaw <152394158+sb123sb123@users.noreply.github.com>
Co-authored-by: 张峻祎 <zhangjunyi20130307@163.com>
Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>

* chore: unskip E722 ruff rule and actualize ruff config (The-PR-Agent#3993)

Co-authored-by: even-even <>
Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* fix(review): escape HTML, convert newlines to <br>, and render nested YAML in unknown review keys (The-PR-Agent#3975) (The-PR-Agent#3976)

Co-authored-by: Ankita-Advitot <ankita.advitot@joshsoftware.com>

* Allow extra review fields (The-PR-Agent#3998)

* fix(jira): keep jira_site and project_keys host-only (The-PR-Agent#4001)

* fix: create missing AWS secrets (The-PR-Agent#3930)

* fix(review): render url-less ticket compliance without dead link (The-PR-Agent#4000)

* perf(gerrit): walk the commit diff once per provider instance (The-PR-Agent#3935)

* fix(review): allow disabling failure comments (The-PR-Agent#4011)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>

* fix(bitbucket-server): build line links on the canonical PR URL (The-PR-Agent#4015)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(diff): use set for included-file metadata checks (The-PR-Agent#4017)

* fix(gerrit): reset local edits after failed patch uploads (The-PR-Agent#4021)

* fix(review): keep url-less ticket compliance entries distinct (The-PR-Agent#3999)

* perf(routing): count diff hunks only when needed (The-PR-Agent#4008)

* fix(litellm): warn on invalid config.max_output_tokens and enforce a 4096 floor (The-PR-Agent#4013)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix: report clipped patches as partial input coverage (The-PR-Agent#4019)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* fix(gitea): keep failed guidance reads out of caches (The-PR-Agent#4016)

Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>

* chore: rename merge_recommendation values to describe findings (The-PR-Agent#4010)

* feat(artifacts): choose which end of the file truncation keeps (The-PR-Agent#3990)

* feat(review): add opt-in failure modes (The-PR-Agent#4012)

Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>
Co-authored-by: IsmaelMartinez <ismael.martinez@postcodelottery.co.uk>
Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(review): honor explicit Azure key-issue dismissals (The-PR-Agent#4025)

* fix(bitbucket): report request failures before falling back (The-PR-Agent#4022)

* fix(security): reject non-public destination address ranges (The-PR-Agent#4024)

* fix(improve): fence a suggestion with more backticks when its code has a fence (The-PR-Agent#3791)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>

* fix: redact CI artifact credentials before prompt injection (The-PR-Agent#3989)

* fix: find suggestion fence closers without a lazy scan (The-PR-Agent#4028)

* fix: account for CI in merge recommendation (The-PR-Agent#4031)

* fix: pass CI artifact context into suggestion self-reflection (The-PR-Agent#4034)

* chore: remove unused code suggestion parser (The-PR-Agent#4035)

* feat: export PR reviews as JSON (The-PR-Agent#4033)

* fix(gitlab): load host settings before note provider lookup (The-PR-Agent#4023)

* fix: improve skills budget warnings (The-PR-Agent#3865)

* feat: cache the shared skills prefix across review tools (The-PR-Agent#4014)

* fix(gerrit): skip symlink and git-metadata suggestion paths (The-PR-Agent#3915)

Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix: skip empty insights section in review output (The-PR-Agent#4038)

* fix(openrouter): attribute model requests to PR-Agent (The-PR-Agent#4039)

* fix(diff): keep unreadable file notices in chunked diffs (The-PR-Agent#4041)

* perf(github): resolve merge base only when needed (The-PR-Agent#4044)

* fix(github): avoid retrying permanent diff collection failures (The-PR-Agent#4045)

* fix: tolerate missing effort field in review labels (The-PR-Agent#4047)

* fix: merge extra config keys case-insensitively (The-PR-Agent#4037)

* feat(review): honor human-resolved GitHub key issues (The-PR-Agent#4032)

* feat(ci): enable PR Agent on PR Agent (The-PR-Agent#4002)

* fix(ci): read the comment event from GITHUB_EVENT_PATH in PR-Agent authorization (The-PR-Agent#4050)

* feat(ci): post PR-Agent output as the PR Agent GitHub App when configured (The-PR-Agent#4051)

* chore(models): prune retired and obsolete static model entries (The-PR-Agent#4026)

* fix: keep review finding location when end line is empty (The-PR-Agent#4036)

* chore: up html2text to 2025.4.15 (The-PR-Agent#4055)

Co-authored-by: even-even <>

* perf(diff): bound tokenization when trimming filename metadata (The-PR-Agent#4056)

* fix(models): correct Claude Sonnet 4.6 and Opus 4.6 context windows (The-PR-Agent#4058)

* fix(improve): avoid model fallback for empty analyzable diffs (The-PR-Agent#4057)

* fix(azure): surface diff collection failures (The-PR-Agent#4060)

* fix: restrict LiteLLM callbacks to deployment settings (The-PR-Agent#4054)

* fix: cap github suggestion body length (The-PR-Agent#4053)

* fix: keep quoted command setting values as strings (The-PR-Agent#4048)

* fix(litellm): observe detached stream cleanup failures (The-PR-Agent#4042)

* chore: remove unused JSON repair helpers (The-PR-Agent#4061)

* fix: close file handle in bitbucket manifest handler (The-PR-Agent#4063)

* fix: preserve yaml-prefixed keys in load_yaml (The-PR-Agent#4069)

* fix(docs): preserve Azure DevOps dismissal note during regeneration (The-PR-Agent#4066)

* docs(litellm): clarify shared skills and per-tool cache breakpoints (The-PR-Agent#4065)

* fix(settings): redact shared errors and retry transient fetches (The-PR-Agent#4071)

* perf(yaml): avoid reparsing unchanged failed input (The-PR-Agent#4073)

* fix(tickets): deduplicate GitHub issue references by identity (The-PR-Agent#4072)

* docs: add Heabsy to changing_a_model (The-PR-Agent#3755)

* docs: add DemonRoute to changing_a_model (The-PR-Agent#4074)

* docs: use a concrete DemonRoute model in example (The-PR-Agent#4075)

* Document RelaxAI OpenAI-compatible setup (The-PR-Agent#4076)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>

* feat: add Nemotron reasoning model support with configurable trigger (#2)

- Add nemotron_reasoning_models and nemotron_reasoning_trigger config options
- Add NEMOTRON_REASONING_MODELS constant in pr_agent/algo/__init__.py
- Add _apply_nemotron_trigger() helper in LiteLLMAIHandler
- Apply trigger on normal path (before user_message_only/custom_reasoning_model)
- Add real unit tests in tests/unittest/test_nemotron_reasoning.py

* feat: add review gate to enforce APPROVE/REQUEST_CHANGES verdict (#1)

* fix(review-gate): empty/stringified key_issues -> APPROVE; readable rendering; type-safe security_concerns (#3)

* security: build reviewer image from audited fork source (#4)

* docs: Fix Dockerfile path in gitea installation instructions (The-PR-Agent#2524)

Previously an inexistant absolute path is used, leads to a file not found error.

* chore(deps): Upgrade LiteLLM to the latest stable version v1.92.0 (The-PR-Agent#2521)

The reviewed releases contain no project-wide breaking changes and add
model mappings and broader provider coverage, plus improvements to
streaming, routing, observability, and security hardening. The upstream
LiteLLM image OpenSSL patch does not apply to this project's base image.

Stable release lines reviewed:
v1.84.x (v1.84.0-v1.84.10), v1.85.x (v1.85.0-v1.85.7),
v1.86.x (v1.86.0-v1.86.7), v1.87.x (v1.87.0-v1.87.5),
v1.88.x (v1.88.0-v1.88.5), v1.89.x (v1.89.0-v1.89.6),
v1.90.x (v1.90.0-v1.90.4), v1.91.x (v1.91.0-v1.91.3),
and v1.92.0.

Stable release references:
- https://pypi.org/project/litellm/1.84.0/
- https://pypi.org/project/litellm/1.84.1/
- https://pypi.org/project/litellm/1.84.2/
- https://pypi.org/project/litellm/1.84.3/
- https://pypi.org/project/litellm/1.84.4/
- https://pypi.org/project/litellm/1.84.5/
- https://pypi.org/project/litellm/1.84.6/
- https://pypi.org/project/litellm/1.84.7/
- https://pypi.org/project/litellm/1.84.8/
- https://pypi.org/project/litellm/1.84.9/
- https://pypi.org/project/litellm/1.84.10/
- https://pypi.org/project/litellm/1.85.0/
- https://pypi.org/project/litellm/1.85.1/
- https://pypi.org/project/litellm/1.85.2/
- https://pypi.org/project/litellm/1.85.3/
- https://pypi.org/project/litellm/1.85.4/
- https://pypi.org/project/litellm/1.85.5/
- https://pypi.org/project/litellm/1.85.6/
- https://pypi.org/project/litellm/1.85.7/
- https://pypi.org/project/litellm/1.86.0/
- https://pypi.org/project/litellm/1.86.1/
- https://pypi.org/project/litellm/1.86.2/
- https://pypi.org/project/litellm/1.86.3/
- https://pypi.org/project/litellm/1.86.4/
- https://pypi.org/project/litellm/1.86.5/
- https://pypi.org/project/litellm/1.86.6/
- https://pypi.org/project/litellm/1.86.7/
- https://pypi.org/project/litellm/1.87.0/
- https://pypi.org/project/litellm/1.87.1/
- https://pypi.org/project/litellm/1.87.2/
- https://pypi.org/project/litellm/1.87.3/
- https://pypi.org/project/litellm/1.87.4/
- https://pypi.org/project/litellm/1.87.5/
- https://pypi.org/project/litellm/1.88.0/
- https://pypi.org/project/litellm/1.88.1/
- https://pypi.org/project/litellm/1.88.2/
- https://pypi.org/project/litellm/1.88.3/
- https://pypi.org/project/litellm/1.88.4/
- https://pypi.org/project/litellm/1.88.5/
- https://pypi.org/project/litellm/1.89.0/
- https://pypi.org/project/litellm/1.89.1/
- https://pypi.org/project/litellm/1.89.2/
- https://pypi.org/project/litellm/1.89.3/
- https://pypi.org/project/litellm/1.89.4/
- https://pypi.org/project/litellm/1.89.5/
- https://pypi.org/project/litellm/1.89.6/
- https://pypi.org/project/litellm/1.90.0/
- https://pypi.org/project/litellm/1.90.1/
- https://pypi.org/project/litellm/1.90.2/
- https://pypi.org/project/litellm/1.90.3/
- https://pypi.org/project/litellm/1.90.4/
- https://pypi.org/project/litellm/1.91.0/
- https://pypi.org/project/litellm/1.91.1/
- https://pypi.org/project/litellm/1.91.2/
- https://pypi.org/project/litellm/1.91.3/
- https://pypi.org/project/litellm/1.92.0/

* AI: fix(gitea): allow description updates without titles (The-PR-Agent#2526)

* fix(gitea): allow description updates without titles

Make the Gitea pull request edit wrapper accept an omitted title and only include the title field in the request when one is supplied. This preserves manually edited titles when AI title generation is disabled.

Add coverage for description updates both with and without a title.

Fixes The-PR-Agent#2525.

Assisted-by: Codex:GPT-5.6
Tested-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>

* lint(gitea): Conform to the project's quoting style requirements.

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>

---------

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>

* Honor reasoning_effort for Gemini 2.5 (and provider-prefixed reasoning models) (The-PR-Agent#2520)

SUPPORT_REASONING_EFFORT_MODELS contained only bare o3/o4 ids, and the gate in
LiteLLMAIHandler.chat_completion used an exact-string `model in
self.support_reasoning_models` test. So a configured `reasoning_effort` was
silently dropped for two cases:

  1. Gemini 2.5 (pro/flash), which support a thinking budget LiteLLM maps from
     reasoning_effort — they were never in the list.
  2. Any reasoning model referenced with a provider prefix (e.g.
     "openrouter/o3", "openrouter/google/gemini-2.5-pro"), because the prefixed
     string never equals the bare id.

For Gemini this matters beyond a missing knob: with reasoning uncapped, a runaway
thinking trace can consume the whole output budget and return an empty completion.

- Add gemini-2.5-pro / gemini-2.5-flash to SUPPORT_REASONING_EFFORT_MODELS.
- Match the bare id OR any "<provider>/<id>" suffix form, so prefixed configs are
  covered without over-matching (e.g. "my-gemini-2.5-pro" is not matched).
- Tests covering prefixed forms, non-listed Gemini (1.5), and the no-overmatch
  boundary.

Co-authored-by: Claude (agent-generated) <noreply@anthropic.com>

* feat(openrouter): add provider routing and reasoning controls (The-PR-Agent#2518)

* feat(openrouter): add provider routing and reasoning controls

Add an [openrouter] configuration section that lets operators restrict which
upstream providers OpenRouter uses, control reasoning, and cap completion
length for models addressed as "openrouter/...".

The LiteLLM handler now injects, only for openrouter/* models:
- extra_body.provider.only (hard allowlist) or provider.order + allow_fallbacks
- extra_body.reasoning (effort, "none" to disable, or a max_tokens budget)
- a hard max_tokens cap on the completion

Every key defaults to unset, so the block is a no-op unless configured and never
affects other providers. Includes documentation and unit tests covering provider
routing, reasoning control, the output cap, and the no-op and non-openrouter cases.

Refs: sparkfabrik-innovation-team/board#4593
Assisted-by: claude-code/claude-opus-4-8

* fix(openrouter): cap max_tokens, fix test isolation and mock

Address review feedback:
- openrouter.max_tokens now caps kwargs["max_tokens"] (min with any value set
  earlier) instead of overwriting it, matching the documented hard-cap semantics.
- Follow the repository's MagicMock response pattern (__getitem__.side_effect and
  dict.return_value) in the unit test.
- Snapshot and restore the global litellm/openai state that LiteLLMAIHandler.__init__
  mutates, so the tests no longer leak state across the suite.

Refs: sparkfabrik-innovation-team/board#4593
Assisted-by: claude-code/claude-opus-4-8

* fix(openrouter): keep openrouter prefix when azure mode is enabled

Azure mode rewrote every model to "azure/<model>", so an "openrouter/..." model
became "azure/openrouter/...": the request was misrouted away from the OpenRouter
api_key/api_base configured in __init__, and the OpenRouter controls block (guarded
by the "openrouter/" prefix) was silently skipped. Exclude openrouter models from
the azure rewrite, following the existing databricks guard, and add a regression
test for azure mode with an openrouter model.

Refs: sparkfabrik-innovation-team/board#4593
Assisted-by: claude-code/claude-fable-5

* fix(openrouter): isolate handler env vars in unit tests

LiteLLMAIHandler.__init__ reads AWS_USE_IMDS and, when set, mutates the AWS_*
credential variables in os.environ; it also reads OPENAI_API_KEY. The autouse
fixture now snapshots and restores these variables and drops AWS_USE_IMDS for
the duration of each test, so the AWS credential path never runs and the tests
stay deterministic regardless of the host environment.

Refs: sparkfabrik-innovation-team/board#4593
Assisted-by: claude-code/claude-fable-5

* fix(gitlab): allow overriding is_bot_user indicators  (The-PR-Agent#2528)

* feat(gitlab): allow overriding is_bot_user indicators via gitlab.bot_user_indicators

Introduces a new optional GitLab setting that lets operators replace the
hardcoded bot-name substrings used to skip GitLab webhook events. When
unset, behavior is unchanged (defaults to
['codium', 'bot_', 'bot-', '_bot', '-bot']). Operators can now include
sender names like 'renovate' or 'dependabot' without patching the code.

Adds unit coverage for both the default list and the override path.

* fix(gitlab): normalize bot_user_indicators and centralize default in configuration.toml

Addresses Qodo review feedback on The-PR-Agent#2528:

- Move the default list from a Python literal to a real Dynaconf default in
  configuration.toml so there's one source of truth (fix: hardcoded default).
- Normalize the value read from settings: coerce a bare string to a single-item
  list, drop non-string entries, and log-and-empty on non-iterable values so a
  misconfigured .pr_agent.toml can't crash bot detection (fix: input validation).
- Lowercase indicators before matching so operator-supplied entries like
  "Renovate" behave case-insensitively as the doc comment claims (fix: case bug).
- Tighten the configuration.toml comment to state plainly that overrides REPLACE
  the default list (fix: ambiguous "extend or replace" wording).

Adds three new tests: case-insensitive matching, string-not-list normalization
(with an explicit guard against per-character iteration), and non-string entry
filtering. Existing default-indicator tests simplified now that the TOML entry
is authoritative.

* refactor(config): move bot_user_indicators from [gitlab] to [config] for reuse

Follow-up to review feedback on The-PR-Agent#2528 from @naorpeled: generalize the setting
so other providers can adopt it later.

The setting now lives under [config] alongside ignore_pr_authors and the
other cross-provider filters. Only the GitLab webhook consumes it today;
follow-up work can wire it into bitbucket_server_webhook, gitea_app, or any
other provider whose payload lacks a native bot flag. GitHub and Bitbucket
Cloud already use provider-native type flags (sender.type == 'Bot',
actor.type) and should keep doing so — those signals are higher fidelity
than a substring list.

- pr_agent/settings/configuration.toml: move bot_user_indicators from
  [gitlab] to [config]; reword the comment to be provider-neutral.
- pr_agent/servers/gitlab_webhook.py: read from
  config.bot_user_indicators instead of gitlab.bot_user_indicators; update
  the inline comment to note the setting is intentionally cross-provider.
- tests/unittest/test_webhook_logic_core.py: rename all four
  GITLAB.BOT_USER_INDICATORS references to CONFIG.BOT_USER_INDICATORS.
  All 17 tests continue to pass; no behavioral change.

* Add Dockerfile for building pr-agent from source to address security concerns

This Dockerfile builds the PR-Agent application from source instead of relying on the unverified base image pragent/pr-agent:0.39.0-github_app. This addresses security concerns by ensuring that the reviewer image is built from our audited fork source rather than potentially unverified Docker Hub base images.

* Security: Implement reviewer image from fork source

This PR implements the security enhancement to replace the unverified base image with a source-built Docker image. The new Dockerfile builds the pr-agent application directly from our audited fork source instead of relying on potentially unverified Docker Hub base images.

---------

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
Co-authored-by: 林博仁 Buo-ren Lin <Buo.Ren.Lin@gmail.com>
Co-authored-by: Peter Dave Hello <3691490+PeterDaveHello@users.noreply.github.com>
Co-authored-by: Mattias Petter Johansson <mpj@mpj.me>
Co-authored-by: Claude (agent-generated) <noreply@anthropic.com>
Co-authored-by: Fabrizio Cafolla <developer@fabriziocafolla.com>
Co-authored-by: Allen Shearin <allen.p.shearin@gmail.com>

* fix(image): harden reviewer container - pin deps and drop root privileges (#5)

* build: add Dockerfile to build reviewer from fork source with digest-pinned base

Adds a root Dockerfile that builds the github_app reviewer image directly
from this fork's source (pip install . + pr_agent source), replacing the
unverified pragent/pr-agent:0.39.0-github_app Docker Hub base. The image is
a drop-in: same WORKDIR (/app), same CMD (gunicorn serving
pr_agent.servers.github_app:app), same exposed port 3000/tcp, no ENTRYPOINT,
PYTHONPATH=/app. Base image python:3.12.13-slim is pinned by sha256 digest.
No secrets are baked in (.dockerignore excludes .secrets.toml/.env; secrets
are bind-mounted at runtime from ~/.pr-agent/.secrets.toml).

* docs: document reviewer image swap and rollback procedure

Adds docs/docs/installation/reviewer_image_swap.md with exact build,
verify, push, redeploy and rollback commands for swapping the running
pr-agent-reviewer container to the fork-built image, plus the runtime
contract (name, restart policy, port 127.0.0.1:3033->3000, secrets
bind-mounts) and a note that pr-agent-poller is unaffected. Registers the
page in the MkDocs nav under a new Operations section.

* fix: copy all build inputs to Dockerfile so pip install . installs the real package

The original Dockerfile ran `pip install .` with only pyproject.toml/requirements.txt/docs
in the context. pyproject.toml declares readme=README.md and license={file=LICENSE},
and setuptools needs the pr_agent package to produce a real wheel. Without README.md,
LICENSE, MANIFEST.in and pr_agent present the build yields a metadata-only wheel
(no modules installed). Copy all build inputs before installing, so pr_agent is
genuinely installed rather than relying on PYTHONPATH at runtime.

* fix(image): harden reviewer container - pin deps and drop root privileges

Two security findings from upstream code review:

Finding 1 - floating build dependencies:
- APT: pin git and curl to exact Debian 13 (trixie) versions in the same
  apt-get install line; apt lists cleaned in the same layer.
- Python: generate a fully-pinned, hash-locked requirements.lock via
  pip-compile --generate-hashes (Python 3.12, linux/amd64) and install with
  --require-hashes.  The package itself is installed with --no-deps so pip
  does not re-resolve the >= ranges in requirements.txt.  This makes two
  builds of the same commit produce identical dependency sets.
- What cannot be pinned: the APT *mirror* is not frozen to a Debian snapshot
  — only the resolved package versions are pinned.  A future improvement
  could pin the snapshot URL or use apt-pinning to a specific release.

Finding 2 - runs as root:
- Create an unprivileged system user (appuser, uid 999) with a writable
  home directory (needed by azure-devops and litellm at import time).
- chown /app and /home/appuser to appuser; make the settings dir
  world-readable (it contains no secrets in the image).
- Switch to USER appuser before the CMD.
- Runtime note: the bind-mounted .secrets.toml must be readable by the
  appuser UID (e.g. chmod 644 on the host file).

Verified:
- docker build -t pr-agent-fork-harden -f Dockerfile . → BUILD_EXIT=0
- docker run --rm --entrypoint sh pr-agent-fork-harden -c "id -u" → 999
- docker run --rm --entrypoint sh ... -c 'python -c "from pr_agent.servers.github_app import app"' → OK
- docker run ... gunicorn binds to port, 4 workers boot, app startup complete

* fix(config): read nemotron reasoning settings with safe defaults

* test: populate nemotron config in mock config.get()

* fix: clean up placeholder on review failure, dismiss stale bot CHANGES_REQUESTED, raise gunicorn timeout (#7)

Resolved cherry-pick conflicts with fork/main (which has review-gate,
request_changes, and parsed_review_data additions).

BUG 1: try/finally ensures remove_initial_comment() runs on every exit
path - normal return, early return, and exception. Without this, a
failed LLM call leaves 'Preparing review...' on the PR forever.

BUG 2: dismiss_stale_changes_requested_reviews() added to GithubProvider.
When a fresh review of the current head finds no key issues and no
security concerns, the bot's own prior CHANGES_REQUESTED reviews are
dismissed via GitHub's PUT /reviews/{id}/dismissals endpoint. Only
bot-authored reviews are ever dismissed - never a human's.

Gunicorn timeout raised from 240s to 600s (configurable via
GUNICORN_TIMEOUT env var) to match ai_timeout, preventing the master
from SIGABRTing the worker mid-review.

* fix(providers): add missing should_publish_review_as_thread and create_review (#9)

* docs: update configuration reference for nemotron and review-gate keys

The new-base Docusaurus config-reference test requires the generated page to match configuration.toml; regenerate after the fork's nemotron_reasoning_* and enable_review_gate keys land.

* fix: guard dismiss_stale call for providers lacking the method

The guard uses getattr so hand-rolled provider test doubles (and any third-party provider not inheriting the GitProvider base no-op) do not crash clean reviews. Also drops the NEMOTRON_REASONING_MODELS import in litellm_ai_handler.py, which became unused after the merge kept the base's config .get() pattern.

* style: wrap long comment flagged by ruff E501

* style: fix ruff F401/E501 in fork test files

* test: bump config key count constant for the 3 fork-added keys

The new base's test hardcodes the active key count (287). The fork adds nemotron_reasoning_models, nemotron_reasoning_trigger and enable_review_gate, so the count is 290 on this branch.

* docs: add Docusaurus front matter and sidebar entry to reviewer image page

The fork's reviewer_image_swap page landed via the cherry-picked hardening commit without the YAML front matter or sidebars.js registration that the new base's docs-nav parity tests require.

* style: apply pre-commit trailing-whitespace and end-of-file-fixer fixes

* fix: initialize code suggestion publication status

* fix: validate GitHub API URL hosts precisely

* test: enable jinja2 autoescape in prompt-fragment tests (CodeQL py/jinja2/autoescape-false)

---------

Signed-off-by: teachershuang <guhongkaiailaopo@gmail.com>
Signed-off-by: Yunare Maia <yunare@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: 张峻祎 <zhangjunyi20130307@163.com>
Signed-off-by: NekoPaw <152394158+sb123sb123@users.noreply.github.com>
Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
Co-authored-by: Peter Dave Hello <3691490+PeterDaveHello@users.noreply.github.com>
Co-authored-by: Utsab Dahal <134686066+utsab345@users.noreply.github.com>
Co-authored-by: Alex Tumanov <oleksii.tumanov@gmail.com>
Co-authored-by: charlieanna <ankothari@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Grapette.L <90967079+Lesereingrape@users.noreply.github.com>
Co-authored-by: OUAO-FRANK <152768228+OUAO-FRANK@users.noreply.github.com>
Co-authored-by: Ismael Martinez Ramos <ismaelmartinez@gmail.com>
Co-authored-by: Ismael Martinez Ramos <ismael.martinez@postcodelottery.co.uk>
Co-authored-by: Abreham Melese <truecallerabreham@gmail.com>
Co-authored-by: Abreham Melese <xvimelese@gmail.com>
Co-authored-by: Yoel-qin <68601420+Yoel-qin@users.noreply.github.com>
Co-authored-by: qyy <qyy@8023.com>
Co-authored-by: Naor Peled <me@naor.dev>
Co-authored-by: JWM <62558419+JokeWaumans@users.noreply.github.com>
Co-authored-by: Ismael Martinez <430992+IsmaelMartinez@users.noreply.github.com>
Co-authored-by: strawberry-little-bear <jiaxuanxu94@gmail.com>
Co-authored-by: Alex Tumanov <6143578+oleksii-tumanov@users.noreply.github.com>
Co-authored-by: Vladimir Roshchin <51440383+even-even@users.noreply.github.com>
Co-authored-by: Arta <110603089+Arta-shoja@users.noreply.github.com>
Co-authored-by: Arta Shoja <arta.shoja@postcode-lotterie.de>
Co-authored-by: Kudala Bharani Kumar Reddy <bunnykudala@gmail.com>
Co-authored-by: Pranav Deshpande <134182346+PranavD2905@users.noreply.github.com>
Co-authored-by: Hrishikesh Yadav <rishiicreates@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hugo Knorr <140080567+hkn-wt@users.noreply.github.com>
Co-authored-by: Tony Nguyen <91400591+truongbo17@users.noreply.github.com>
Co-authored-by: truongnq <truongnq@local.com>
Co-authored-by: NekoPaw <152394158+sb123sb123@users.noreply.github.com>
Co-authored-by: Felix Schaefer <89661132+YokoAC@users.noreply.github.com>
Co-authored-by: Peace. A <starstorm1688@gmail.com>
Co-authored-by: teachershuang <148217352+teachershuang@users.noreply.github.com>
Co-authored-by: Erez Lev <erezlev1994@gmail.com>
Co-authored-by: NesrineGharbi77 <161094617+NesrineGharbi77@users.noreply.github.com>
Co-authored-by: Anjankumar LN <anjankumarln120@gmail.com>
Co-authored-by: noooooooookro <1506769455@qq.com>
Co-authored-by: nightcityblade <jackchen@haloailabs.com>
Co-authored-by: nightcityblade <nightcityblade@gmail.com>
Co-authored-by: Brown <77201076+brown-sussy@users.noreply.github.com>
Co-authored-by: Amazing <77201076+black-fruit@users.noreply.github.com>
Co-authored-by: abhi26 <49560440+abhinavrastogi2627@users.noreply.github.com>
Co-authored-by: Yunare Maia <yunare@gmail.com>
Co-authored-by: yunaremaia <41013139+yunaremaia@users.noreply.github.com>
Co-authored-by: strawberry-little-bear <strawberry-little-bear@users.noreply.github.com>
Co-authored-by: Abhinav Maurya <156442109+Fire162@users.noreply.github.com>
Co-authored-by: Abhishek Jha <abhi91temp@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnkitaAdvitot <110318342+AnkitaAdvitot@users.noreply.github.com>
Co-authored-by: Ankita-Advitot <ankita.advitot@joshsoftware.com>
Co-authored-by: Isaac Emmanuel <35623334+1cbyc@users.noreply.github.com>
Co-authored-by: insisong <emmanuelisaacnsisong@gmail.com>
Co-authored-by: Havi007 <gangisettyhavinash@gmail.com>
Co-authored-by: Evhye38496 <evhye38496@gmail.com>
Co-authored-by: Eastern <a897889110@gmail.com>
Co-authored-by: 张峻祎 <zhangjunyi20130307@163.com>
Co-authored-by: Jin <a3239737781@gmail.com>
Co-authored-by: jiuyueQ <631905507@qq.com>
Co-authored-by: Harsh Raj Singhania <40535627+HarshRajSinghania@users.noreply.github.com>
Co-authored-by: karthi040506 <karthikeyan9vibrant@gmail.com>
Co-authored-by: ofir-frd <85901822+ofir-frd@users.noreply.github.com>
Co-authored-by: Allen Shearin <allen.p.shearin@gmail.com>
Co-authored-by: kafomichev <117214864+kafomichev@users.noreply.github.com>
Co-authored-by: Demon Route <payup2@nftdemon.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Co-authored-by: 林博仁 Buo-ren Lin <Buo.Ren.Lin@gmail.com>
Co-authored-by: Mattias Petter Johansson <mpj@mpj.me>
Co-authored-by: Fabrizio Cafolla <developer@fabriziocafolla.com>
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.

3 participants