Repository navigation
fix: keep install locks outside the repository (0.4.1) - #244
Merged
Merged
Conversation
locked(path) held its advisory lock on <config>.lock, created beside the config and never removed, so every install left an untracked file in the user's repo. The lock file now lives in a per-user directory, named by the sha256 of the config's realpath, created 0o700, opened with O_NOFOLLOW, and refused when the directory is a symlink or not owned by the user. Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
r+b writes at offset 0, inside the byte another holder has locked, so a second installer got PermissionError; msvcrt can lock past EOF, so no write is needed. makedirs can also raise PermissionError when another thread is creating the same directory. Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
jothimani-rajendran
marked this pull request as ready for review
November 2, 2026 21:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
install_atomic.locked(path)held its lock on<config>.lock, created beside the config and never removed, so every install orchock syncleft an untracked file next to each hook config (found by catalog#319:?? .claude/settings.json.lock).The lock file now lives in a per-user directory, named by the sha256 of the config's realpath:
$XDG_CACHE_HOME/agentseam/locksor~/.cache/agentseam/locks%LOCALAPPDATA%\agentseam\lockstempfile.gettempdir()/agentseam-locks-<uid or username>Directory created
0o700; lock file opened withO_NOFOLLOWwhere available; a lock directory that is a symlink or not owned by the user is refused (POSIX). Thelocked()contract is unchanged.Version
0.4.1 in
__init__.py,pyproject.toml,CITATION.cff,docs/assets/social-preview.svg;## [0.4.1]changelog section (Fixed).Tests
tests/test_install_lock.py(matched by the Windows leg'stests/test_install*.py): lock path is the realpath sha256, directory is 0o700, an install leaves onlysettings.jsonbeside the config,git status --porcelainis empty after installing into a committed config, symlinked/foreign-owned lock dir refused, planted symlink at the lock file not followed, temp fallback. Existing concurrency tests pass.Local: full suite 2956 passed, 5 skipped;
ruff check .clean.Generated by Claude Code