Repository navigation
sym 0.13.13 — a crashed Windows session no longer locks its node name until reboot - #44
Merged
Merged
Conversation
… lock whose PID started later processStartTime() returned null on win32, so Windows locks carried no start time and a crashed holder's recycled PID kept the name locked until reboot. Windows now reads it through PowerShell (UTC ISO-8601, same form for writer and reader). A lock with no start time, written this boot, is stale when its PID's process started after the file was written. Reported by claude-sym-agent-a; Windows verification by claude-sym-agent-x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- F1/F2/F10 drop the pid-only mtime heuristic: a clock step could make a live holder look stale, and it was not gated to Windows; a live holder must never lose its lock. 0.13.12-era locks still need a reboot or a manual delete, as documented. - F3 cache Windows start times per PID for 10 s (one PowerShell spawn per holder process during a daemon's node scan) - F4 run the system PowerShell by absolute path, and accept only a UTC ISO-8601 answer - F5 warn once when a start time cannot be read (still treated as held) - F6 a failed self start-time lookup is retried, not cached - F7 test that a live holder whose recorded start matches is still held - F9 bound the pid before it reaches the command line - F11 CHANGELOG states what is covered and what is not Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKQsnKr82ygK5YEef85PAn
…medir()) The test sandbox set HOME only. On Windows os.homedir() reads USERPROFILE, so an unsandboxed npm test wrote node dirs into the real ~/.sym/nodes and ~/.sym/loopback, and the ask tests ran `sym ask` against the user's real mesh memory. Found by claude-sym-agent-x on Windows 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKQsnKr82ygK5YEef85PAn
…, not the cache With the 10 s per-PID cache, the second call read the cache and no longer checked that PowerShell's output is stable. A test-only hook clears the cache before each call. Review note by claude-sym-agent-x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKQsnKr82ygK5YEef85PAn
…d-API path in the ask test - daemon-relay-only and the discovery exit-hook child set USERPROFILE with HOME, so a Windows child no longer writes into the real ~/.sym - identity-halt and ask load _isolate-home: identity-halt created a real ~/.sym/nodes/agent-g@mesh, and the ask test's NO_PROVIDER check let llm-reason's ensureEnv() read ~/.sym/relay.env from the real home, which can supply an API key and make a real, paid call with the prompt "hi" Found by claude-sym-agent-x running a plain npm test on Windows 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKQsnKr82ygK5YEef85PAn
…E sandbox p6-legacy-grandfather, rule-a-collapse and the five integration tests created their nodes in the real ~/.sym/nodes and deleted them afterwards (a watcher on the real directory saw p6-* and rule-a-* come and go; the transient write claude-sym-agent-x observed on Windows). With _isolate-home loaded, a full unit + integration run leaves no event in the real directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKQsnKr82ygK5YEef85PAn
sym-bot
marked this pull request as ready for review
October 1, 2026 12:48
sym-bot
added a commit
that referenced
this pull request
Oct 1, 2026
… node name until reboot Windows identity-lock fix (#44) and test isolation. See CHANGELOG.md 0.13.13.
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.
Problem
On Windows,
processStartTime()returnednullbecause there is nops. So the identity lock never recorded its holder's start time, andlockIsHeldByLiveProcess()trusted any live PID written during the current boot. After a crash or a hard-killed terminal, Windows soon reuses the PID, and the agent's name stays locked (EIDENTITYLOCK) until reboot.Reported by claude-sym-agent-a. Confirmed in production by claude-sym-agent-x: a live Windows node's
lock.pidreads{"start":null}.Fix (
lib/config.js)powershell.exe -NoProfile -NonInteractive -Command "(Get-Process -Id N).StartTime.ToUniversalTime().ToString('o')"(5 s timeout). The lock writer (for itself) and a later reader (for the same PID) produce the same string.tasklist/node.execheck was rejected deliberately. An app embedding the SDK isn't necessarilynode.exe, so that check could take a lock away from a live holder.Testing
npm testpasses 627 tests, with 2 Windows-only tests skipped. The new cross-platform test, "reclaims a pid-only lock written this boot when its PID now belongs to a later process", fails before the fix.EIDENTITYLOCKwhen the lock pointed at a live unrelated PID.Cost
About 0.45 s per
powershell.execall on Windows (measured by agent-x):🤖 Generated with Claude Code