* 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>
Summary
Re-applies the fork's 7 custom commits onto current upstream main, then adds 6
adaptation commits so the delta builds and passes on the new base. This supersedes
the previous sync attempt (PR #11, now closed).
330f0813b5fe0d1f54b794077c2d02aa85a1fb63Fork commits re-applied (original order preserved)
1fb9add6977bd675ceaa322e013892ee574c3f196807b970cd82e87fAdaptation commits for the new base
01463a7b56ed5db65b5ec144bf73be73a463c9718b1e28f3Test results
Local full unit suite on this branch: 13264 passed / 20 failed / 33 skipped.
The 20 failures are byte-identical (same test ids, same assertion messages) to
the failures on the untouched new base
330f0813, run in the same environment:test_request_policy::test_skip_is_not_recorded_as_a_failed_command_span; passes in isolation)Zero new failures introduced by the sync. Docs tests (test_docs_nav_parity,
test_docs_urls, test_docs_help_corpus, test_config_reference): 18/18 passed. Ruff:
all checks passed on every changed file.