Skip to content

Fix session progress save on Windows - #8

Open
leo385 wants to merge 1 commit into
Dryxio:mainfrom
leo385:fix/windows-session-save
Open

Fix session progress save on Windows#8
leo385 wants to merge 1 commit into
Dryxio:mainfrom
leo385:fix/windows-session-save

Conversation

@leo385

@leo385 leo385 commented Aug 15, 2026

Copy link
Copy Markdown

Summary

Fix session progress persistence on Windows.

Session.save() currently uses Path.rename() to move the temporary
re-agent-progress.tmp file over re-agent-progress.json.

On Windows, this raises:

FileExistsError: [WinError 183]

when the destination progress file already exists.

This changes Path.rename() to Path.replace(), allowing the temporary
file to replace the existing session file.

Reproduction

Reproduced on Windows 11 while running:

re-agent reverse --address 0x005b8f00

The first session write succeeds, but a subsequent write fails when
re-agent-progress.json already exists.

Changes

  • Replace Path.rename() with Path.replace()
  • Add a regression test for repeated session saves

Testing

Regression test:

pytest tests/test_core/test_session.py -v

Full test suite on Windows:

87 passed, 4 failed

The 4 failures are unrelated existing Windows-specific test issues:

  • YAML parsing of Windows paths with backslashes
  • tests that assume /bin/sh is available

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.

1 participant