Skip to content

fix(file-io): offload move copy from event loop - #425

Closed
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:fix/move-copy-offload
Closed

fix(file-io): offload move copy from event loop#425
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:fix/move-copy-offload

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

Summary

Offload MoveStep's potentially large shutil.copyfile operation so a file move does not block unrelated async service work.

Changes

  • Run the copy phase with asyncio.to_thread.
  • Keep the existing copy -> retarget links -> unlink ordering unchanged.
  • Add a regression test with a controlled slow copy that verifies the event loop remains responsive.

Evidence

Before the fix:

FAILED test_move_copy_does_not_block_event_loop
AssertionError: synchronous copyfile blocked the event loop

After the fix:

1 passed, 48 deselected
49 passed

Validation:

pytest tests/unit/test_crud_steps.py -q
pre-commit run --files reme/steps/file_io/move.py tests/unit/test_crud_steps.py

All checks pass.

Scope

This does not change path validation, overwrite behavior, wikilink retargeting, or source cleanup semantics.

@RerankerGuo RerankerGuo closed this by deleting the head repository Aug 17, 2026
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