Repository navigation
Conversation
Three POSIX assumptions stopped server.py from starting on Windows: - usage_scan built its day bounds from naive datetimes, whose .timestamp() goes through local time and raises OSError before 1970 on Windows, at import. Build them UTC-aware, and floor at the epoch there since fromtimestamp refuses negative values too. - ensure_tool_token adopts an existing token via O_NOFOLLOW, getuid and fchmod, none of which Windows has. Add a Windows path that still refuses links and non-regular files via lstat. - brain and run_executor shlex.split the claude path, which drops the backslashes from C:\Users\...\claude.exe. claude_env.split_command takes an existing file path whole and splits anything else as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Three POSIX assumptions stopped
python server.pyfrom starting on Windows. Each one failed before the server could serve anything:usage_scan.py:_DAY_MIN/_DAY_MAXwere built from naive datetimes..timestamp()on those goes through local time, which raisesOSError: [Errno 22]on Windows for years before 1970, so the import failed. The bounds are now UTC-aware. On Windows the floor is the epoch, becausedatetime.fromtimestampthere also refuses negative values.data_paths.ensure_tool_token: reusing an existing token usedos.O_NOFOLLOW,os.getuidandos.fchmod, which Windows doesn't have, so app startup failed. A Windows-only path (_adopt_tool_token_windows) still refuses links and non-regular files vialstat. It leaves access control to the user profile's ACLs. The POSIX path is unchanged.brain.py/run_executor.py: bothshlex.splittheclaudepath. POSIX splitting treats the backslashes inC:\Users\...\claude.exe(exactly whatshutil.whichreturns) as escapes and drops them, so the brain could never start. The newclaude_env.split_commanduses an existing file path as-is and splits anything else exactly as before.This only gets the server running on Windows. The macOS-only features (AppleScript,
screencapture, Accessibility) still don't work there.Testing
brain ready, and the Fish TTS check passes.os.geteuidintests/test_usage_scan.py, and cp1252 decode errors in four other test files). The POSIX code paths are unchanged apart fromsplit_command, which behaves exactly asshlex.splitdid for anything that isn't an existing file path.🤖 Generated with Claude Code