Repository navigation
Conversation
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.
Summary
acquireLockreturnedfalseboth when another process held the lock and when the lock could not be created at all (a parent path in the way, an unwritable directory, a full disk). Every caller read the second case as "busy":pullprintedsync in progress elsewhereand exited 0 while nothing had synced, retry loops burned their whole budget, and the real cause was never named.This splits the verdict into
acquired | busy | notWritable(LockResult/acquireLockResult, withacquireLockkept as the boolean wrapper) and migrates every caller. AnotWritableverdict names the lock path and reason (the closest existing path when a parent is in the way, otherwise the errno), stops retry loops immediately, and surfaces as an error onpull/push(exit code 1) instead of a silent skip.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lint—oxlinton all changed files is clean. The--type-awarepass cannot run in this checkout (it reportsFailed to find tsgolint executable, i.e. theoxlint-tsgolintdev dependency is missing), not a finding.npx vitest run— the full suite does not complete green on this Windows machine for six pre-existing reasons below; CI on Linux is the real gate.Related Issues
Fixes #999
Notes for Reviewers
notWritableshape reusesNotWritableErrorandexistingAncestorfromgit-exclude.ts(the pattern fix: delivery and local-state bugs (#993) #995 established), so the message style is already familiar and tested.pull: a scope whose sync lock is not-writable is dropped from every clone-consuming stage exactly like a contended scope, reported with the path and reason, and fails the command (process.exitCode = 1).push(both self-mode and git-mode) already fails on contention; it now reports the not-writable reason instead of the generic "another process" line.votes,models/switch,models/profile,pending-learnings,dashboard-collector,jsonl-store,session-collector,secret-store,codex-team-hooks,local-agent,branch-worktree,uninstall) stop immediately onnotWritableinstead of waiting out their retry budget;bootstrap,migrate,source, andlearnings-publishkeep their existing return semantics but name the real cause.EEXISTfrom the exclusive-create path still means "the lock exists" and staysbusy; only theensureDir-timeEEXIST(a file where the lock's directory should be) is classified not-writable.4c1ab4d:tsc --noEmitclean;oxlintclean;vitest runoverupdate(64),lock-atomic(22),migrate(62),votes,model-switch(71),model-profile(30),jsonl-store,session-collector,save-session,import-lock,dashboard-collector(155),push-pending-pr(29),codex-hook-rules,self-worktree-rebind,reports-reader-lock— all pass.main@2cbf556in this environment:git-exclude/mcp-git-exclude(8.3 short-path vs long-path assertions),pending-learnings(POSIX path separators),secret-values/mcp-secrets/source(case or physical-target path shape),local-agenttoken0o600. None are touched by this change.