Repository navigation
Copr API improvements to retries and diagnostics - #642
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces infrastructure error handling (is_infra_error) across the backport, merge request, and rebase agents, and implements a retry mechanism with exponential backoff for Copr API calls. It also refactors tool call cycle handling in the reasoning agent to append unexecuted tool results to memory. The review feedback suggests two important improvements: safely accessing exc.result using getattr in _copr_error_detail to prevent potential AttributeErrors, and restricting the Copr API retry logic to transient HTTP errors (such as 5xx, 408, and 429) to avoid unnecessary retries on client errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
TomasTomecek
left a comment
There was a problem hiding this comment.
LGTM, nicely done, though needs a test fix
- Create fresh agent in merge request agent
This patch revamps the retry mechanism when Copr API is failing (eg 5xx errors and such) and also adds proper diagnostic logging and error propagation so these types of errors can be seen clear in both the logs and the agent output. It also avoid token burn that is currently happening eg when Copr API returns 5xx errors the loop just keeps retrying up to 10 times and then the agent would retry up to 3 times on top of that. The later (3x retries) is not addressed in this patch as this needs to be tackled separately by rethinking how the agents handle infra failures. Another commit in this patch is somewhat related (tool_use/tool_result consistency) but i kept it as separate commit as its not specific to Copr API.