Skip to content

Copr API improvements to retries and diagnostics - #642

Merged
antbob merged 5 commits into
packit:mainfrom
antbob:copr_improvements
Jun 30, 2026
Merged

antbob merged 5 commits into
packit:mainfrom
antbob:copr_improvements

Conversation

@antbob

@antbob antbob commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread ymir/tools/privileged/copr.py
Comment thread ymir/tools/privileged/copr.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Comment thread ymir/tools/privileged/copr.py
TomasTomecek
TomasTomecek previously approved these changes Jun 30, 2026

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, nicely done, though needs a test fix

Comment thread ymir/agents/rebase_agent.py
- Create fresh agent in merge request agent

@nforro nforro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants