Repository navigation
fix(devtools): keep the type daemon; release it at workspace disposal - #4334
Merged
Merged
Conversation
…osal Removing dmypy from worktrees traded 49 seconds per re-gate for memory that a lifecycle hook releases anyway. Measured in a batch worktree: plain mypy 50s, a cold daemon 51s, a warm daemon 1s — and a workspace is gated repeatedly while it is repaired, so only the first run pays. sinnixd now stops the daemon when it removes the worktree, which releases the cache exactly when the workspace it describes is gone. Verification: `devtools verify --quick` green in the main checkout with the daemon in use. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sinity
added a commit
that referenced
this pull request
Aug 27, 2026
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity
added a commit
that referenced
this pull request
Aug 28, 2026
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity
added a commit
that referenced
this pull request
Sep 1, 2026
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[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.
Summary
Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone.
Problem
#4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree:
A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate.
mypy's own idle timeout does not solve it either: a daemon started with
--timeout 10was still running after twenty seconds idle, so that flag cannot be relied on.Solution
sinnixd stops the daemon when it removes a worktree (sinnix
3f8fcea2), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again.Verification
devtools verify --quickgreen in the main checkout with the daemon in use.sinnix side:
nix build .#sinnixdandnix develop --command checkgreen, with a test asserting removal invokesdmypy stopand tolerates a workspace with no provisioned venv.Residual risk
A worktree removed outside
agentctl workspace— by hand, or bygit worktree removedirectly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays.🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA