Repository navigation
ci(pr-agent): disable DeepSeek thinking for /improve fallback - #504
Conversation
PR-Agent injects reasoning_effort=medium (mapped to high on DeepSeek), so CoT can hit max_tokens with empty content. Set reasoning_effort=none and raise ai_timeout for the fallback path.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe workflow now explicitly disables DeepSeek reasoning for structured File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 14 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/pr-agent.yml" line_range="51" />
<code_context>
+ # short structured /improve JSON. See https://api-docs.deepseek.com/zh-cn/guides/thinking_mode
+ config.reasoning_effort: "none"
+ # DeepSeek fallback often needs longer than Gemini free-tier calls.
+ config.ai_timeout: "300"
# LiteLLM retries 429 with exponential backoff.
NUM_RETRIES: "6"
</code_context>
<issue_to_address>
**Slow failures block PR-Agent runs**
When a provider is slow or unavailable and multiple PR-Agent events arrive while retries are in progress, `config.ai_timeout` applies to Gemini as well as DeepSeek, and `NUM_RETRIES: 6` can keep a slow or failing call occupying the sole `pr-agent` concurrency slot through repeated long waits. Other PR-Agent events are delayed, and GitHub may cancel an older pending run when a newer one arrives, so some reviews or suggestions never run.
Limit the longer timeout to fallback calls, or otherwise bound the total run duration so one failing provider cannot hold the shared concurrency slot for an extended period.
</issue_to_address>
### Comment 2
<location path=".github/workflows/pr-agent.yml" line_range="49" />
<code_context>
+ # reasoning_effort=medium (mapped to high). CoT can exhaust max_tokens
+ # and leave content empty (finish_reason=length). Disable thinking for
+ # short structured /improve JSON. See https://api-docs.deepseek.com/zh-cn/guides/thinking_mode
+ config.reasoning_effort: "none"
+ # DeepSeek fallback often needs longer than Gemini free-tier calls.
+ config.ai_timeout: "300"
</code_context>
<issue_to_address>
**Gemini reasoning is disabled**
When a run uses Gemini as its primary model and honors the configured reasoning effort, pR-Agent uses this shared setting for the configured Gemini primary as well as the DeepSeek fallback, so Gemini-primary review and improve calls run with reasoning disabled and deliver less reasoned results.
Apply `reasoning_effort: none` only to DeepSeek fallback requests, or preserve Gemini’s existing reasoning effort.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: .github/workflows/pr-agent.yml:51, .github/workflows/pr-agent.yml:49
PR Code Suggestions ✨Explore these optional code suggestions:
|
Keep global reasoning_effort=none (PR-Agent has no DeepSeek-only knob). Skip same-model timeout retries so Gemini failures fall through faster, and add a job timeout-minutes ceiling for the shared concurrency slot.
Abandon slow PR-Agent runs early; lower ai_timeout so primary + fallback fit inside the job ceiling.
User description
Summary
config.reasoning_effort: noneso DeepSeek flash does not spend the output budget on CoT (fixes emptycontentwithfinish_reason=lengthon Gemini→DeepSeek fallback).config.ai_timeoutfrom 180s to 300s for slower DeepSeek fallback calls.reasoning_effortwas a no-op for these models.Test plan
/improvesuggestions.config.reasoning_effort: nonein the Action log.Summary by Sourcery
Improve PR-Agent reliability by disabling excessive model reasoning and refining timeout and fallback handling.
Bug Fixes:
Enhancements:
CI:
PR Type
Enhancement
Description
Disable DeepSeek reasoning effort in PR-Agent.
Increase AI timeout for fallback requests.
Update configuration comments for PR-Agent workflow.
File Walkthrough
pr-agent.yml
configure PR-Agent reasoning effort and timeout.github/workflows/pr-agent.yml
config.reasoning_effort: "none"to prevent DeepSeek thinkingmode from exhausting tokens.
config.ai_timeoutfrom 180s to 300s for fallback calls.reasoning_efforthandling.