feat: preliminary implementation for daemon + CLI#67
Merged
Conversation
- Use AF_PIPE (named pipes) on Windows instead of AF_UNIX sockets, since AF_UNIX is not reliably supported on Windows Python 3.11 - Add _connection_family() helper in daemon.py, used by both daemon and client - Make daemon_socket_path() return \\.\pipe\cocoindex_code_<user> on Windows - Use os.path.exists() instead of Path.exists() for socket/pipe path checks (more reliable for Windows named pipe paths) - Skip socket file unlink on Windows (named pipes auto-clean on close) - Catch NotImplementedError in add_signal_handler (Windows asyncio limitation) - Catch AttributeError in accept loop settimeout (AF_PIPE has no ._socket) - Fix _find_ccc_executable() to check for ccc.exe on Windows - Stop find_parent_with_marker() traversal at home directory to avoid false positives on CI runners where ~/.git exists - Update tests to use platform-appropriate connection family and socket paths Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The root cause: test_daemon.py's session fixture patched dm.user_settings_dir at the module level, causing this patch to leak across all subsequent test modules. When test_e2e.py teardown called stop_daemon(), it was connecting to the wrong daemon socket and reading a PID file that contained pytest's own PID (written by the thread-based daemon via os.getpid()), then sending SIGTERM to pytest itself. Fixes: - client.py stop_daemon(): add `pid != os.getpid()` guard to never SIGTERM the current process (safety net for thread-based daemons in tests) - test_daemon.py: use COCOINDEX_CODE_DIR env var for isolation instead of directly patching dm.user_settings_dir (which leaked across modules); use yield fixture to restore env var and create_embedder patch at session end Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.
#52