Skip to content

Conversation

@opohorel
Copy link
Collaborator

Check log file size and read only last 1000 lines for files larger than 2000 lines. Add grep as alternative strategy.

Check log file size and read only last 1000 lines for files
larger than 2000 lines. Add grep as alternative strategy.
Copy link
Contributor

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

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 enhances the agent's ability to handle large build logs by introducing a strategy to read only the end of large files, which is a great improvement to prevent context overflow. The change is applied to the backport_agent when it's in build-fixing mode.

My review includes one suggestion to refine the prompt. Specifically, I recommend explicitly mentioning the search_text tool instead of grep. This guides the agent to use the preferred native tool, aligning with the general instructions to avoid using run_shell_command as a last resort.

Additionally, it would be beneficial to apply this same log-reading strategy to the build_agent as well. The build_agent is the first to analyze build logs and is equally susceptible to context overflow issues with large log files. While I cannot comment on that file directly as it's not part of this PR, it's a worthwhile consideration for a follow-up.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

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

thanks, let's try this!

@opohorel opohorel merged commit 0bcfc57 into packit:main Nov 11, 2025
7 checks passed
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.

2 participants