Skip to content

fix stale working directory on agent re-runs - #489

Merged
opohorel merged 1 commit into
packit:mainfrom
opohorel:stale_dir
May 15, 2026
Merged

fix stale working directory on agent re-runs#489
opohorel merged 1 commit into
packit:mainfrom
opohorel:stale_dir

Conversation

@opohorel

Copy link
Copy Markdown
Collaborator

Wipe the entire per-issue working directory at the start of fork_and_prepare_dist_git so re-runs for the same JIRA issue don't hit stale state from a previous attempt.

@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 modifies the fork_and_prepare_dist_git function to wipe the entire JIRA issue working directory before starting, replacing the previous behavior of only deleting the specific package directory. A new unit test was added to verify this cleanup. Feedback highlights a critical security vulnerability regarding path traversal if the JIRA issue identifier is malformed, and raises concerns about the potential for data loss if multiple packages share the same JIRA issue directory.

Comment thread ymir/agents/tasks.py
Comment thread ymir/agents/tasks.py
Wipe the entire per-issue working directory at the start of
fork_and_prepare_dist_git so re-runs for the same JIRA issue
don't hit stale state from a previous attempt.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TomasKorbar
TomasKorbar self-requested a review May 15, 2026 14:01

@TomasKorbar TomasKorbar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@opohorel
opohorel merged commit e700fc7 into packit:main May 15, 2026
9 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