Skip to content

Use unique temp files for concurrent open workflows#46

Merged
eetann merged 2 commits intoeetann:mainfrom
yuki-yano:fix/temp-file-collision
Mar 30, 2026
Merged

Use unique temp files for concurrent open workflows#46
eetann merged 2 commits intoeetann:mainfrom
yuki-yano:fix/temp-file-collision

Conversation

@yuki-yano
Copy link
Copy Markdown
Contributor

This change makes editprompt open use a dedicated temporary workspace for each invocation.
Previously, temp file paths were generated from a timestamp with second-level resolution under a shared temp directory. That meant multiple open processes started within the same second could end up using the same file and overwrite each other.
With this change, each invocation gets its own temp directory via mkdtemp, and the prompt file is created inside that directory. This avoids temp file collisions without changing the overall open workflow.

@yuki-yano yuki-yano force-pushed the fix/temp-file-collision branch 2 times, most recently from 5bb0905 to 5b0c8c4 Compare March 30, 2026 03:46
- use mkdtemp to create a dedicated temp workspace per invocation
- add tests for empty file creation and unique file paths
@yuki-yano yuki-yano force-pushed the fix/temp-file-collision branch from 5b0c8c4 to 61affb9 Compare March 30, 2026 03:50
- use real temp file creation in openEditorAndGetContent tests
- clean up generated temp files after each test
@eetann eetann merged commit eecdccd into eetann:main Mar 30, 2026
1 check 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