Skip to content

Fix native Windows runtime writes blocked by directory sharing locks - #11

Merged
YihongT merged 1 commit into
mainfrom
codex/fix-windows-runtime-rename
Sep 27, 2026
Merged

YihongT merged 1 commit into
mainfrom
codex/fix-windows-runtime-rename

Conversation

@liguilong3

Copy link
Copy Markdown
Collaborator

Fix native Windows project runtime writes failing with sharing violation 32

Loading or creating a project on native Windows failed while publishing
legacy_runtime_import.json. The temporary file was written successfully, but
NtSetInformationFile reopened the target directory for write access because the
rename supplied RootDirectory. That conflicted with the service's own directory
handle, which deliberately permits FILE_SHARE_READ only.

Use a simple target filename with a null RootDirectory to rename within the same
pinned directory. Retain the directory locks, atomic replacement, no-follow
handling, and file identity validation. Update the changelog with the fix and its
validation scope.

Validation

  • Reproduced error 32 with the original implementation in a disposable directory.
  • Verified create, overwrite, and readback with ordinary and Unicode filenames,
    empty content, and a 1 MiB payload.
  • Verified that directory rename remains blocked while pinned and unsafe target
    names are rejected.
  • Launched the real source CLI on native Windows; loaded the previously failing
    project, created a project through the dashboard, saved Agent settings, and
    verified project/settings persistence after restarting the server.
  • Python syntax, git diff --check, and npm 11.15.0 pack --dry-run passed. The
    archive includes the runtime and excludes verification artifacts.

Research execution and paper generation were not run. Other operating systems
were not retested for this change.

Use a simple target name with a null RootDirectory for atomic renames
within the pinned runtime directory. Passing the directory handle caused
Windows to reopen it for write access, conflicting with FILE_SHARE_READ.

Retain directory locks and file identity checks. Document the fix and its
native Windows validation scope in the changelog.

Validated: baseline error 32 reproduction; create/replace/read including
Unicode names and empty data; directory pin and unsafe-name rejection;
dashboard project creation, settings save, and server restart recovery;
Python syntax, git diff --check, and npm pack --dry-run.
Research execution and paper generation were not run.
@YihongT
YihongT merged commit 263895d into main Sep 27, 2026
2 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