Skip to content

feat(cli): add zccache release-handles --path X (#694 Phase 2) - #741

Merged
zackees merged 2 commits into
mainfrom
feat/694-release-handles
Jun 14, 2026
Merged

zackees merged 2 commits into
mainfrom
feat/694-release-handles

Conversation

@zackees

@zackees zackees commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Phase 2 of #694 — the standalone CLI surface for the daemon-side Request::ReleaseWorktreeHandles handler that already exists from #690. Useful for direct-zccache consumers (FastLED CI teardown, sysadmin scripts, anything doing git worktree remove / rmdir on Windows) that need to break the daemon's per-session journal + log handles deterministically before tearing down a path.

What ships

  • zccache release-handles --path <X> [--json] [--endpoint <X>] CLI subcommand: sends Request::ReleaseWorktreeHandles { path } to the daemon and prints the typed result. The daemon's existing safety guard — refuse if the target contains the cache root — surfaces as a non-zero exit + stderr message.
  • ipc::daemon_release_worktree_handles_roundtrip(endpoint, path, recv_timeout) — companion to daemon_control_roundtrip for the one path-carrying request that cannot route through the existing Copy DaemonControlRequest enum. Mirrors the same wire-selection dispatch (Auto / Bincode / Prost / Frame + the broker_lane_active() override) so the new path inherits the same wire semantics as Clear, Status, etc.

Net diff: 4 files changed, 209 insertions(+), 0 deletions. Pure additive surface — no existing callers changed behavior.

Sample output

$ zccache release-handles --path C:\dev\some-worktree
released 3 of 12 session handle(s) under C:\dev\some-worktree
  sessions dropped: s-abc..., s-def..., s-ghi...

$ zccache release-handles --path C:\dev\some-worktree --json
{"inspected":12,"released":3,"sessions_dropped":["s-abc...","s-def...","s-ghi..."],"unreleased":[]}

What is staged for follow-ups in #694

Test plan

  • cargo check -p zccache --bin zccache clean
  • cargo build -p zccache --bin zccache clean
  • zccache release-handles --help renders correctly
  • Manual smoke against a live local daemon — sends the request, daemon returns Response::ReleaseWorktreeHandlesResult with the expected zeros for a path with no matching sessions
  • release-handles added to KNOWN_SUBCOMMANDS so the binary distinguishes the subcommand from a compiler-wrap invocation

Refs #694, #735

Phase 2 of #694 — the standalone CLI surface for the
daemon-side `Request::ReleaseWorktreeHandles` handler that already
exists from #690 work. Useful for direct-zccache consumers
(FastLED CI teardown, sysadmin scripts) that need to break the
daemon's per-session journal + log handles before `git worktree
remove` / `rmdir` on Windows.

## What ships

- `zccache release-handles --path <X> [--json] [--endpoint <X>]` CLI
  subcommand that sends `Request::ReleaseWorktreeHandles { path }`
  to the daemon and prints the typed result. The daemon's existing
  cache-root safety guard (refuse if the target contains the cache
  root) surfaces as a non-zero exit with a stderr message.
- `ipc::daemon_release_worktree_handles_roundtrip(endpoint, path,
  recv_timeout)` — companion to `daemon_control_roundtrip` for the
  one path-carrying request that cannot route through the existing
  `Copy` `DaemonControlRequest` enum. Mirrors the same wire-
  selection dispatch (`Auto`/`Bincode`/`Prost`/`Frame` with the
  broker-lane override) so the new path inherits the same wire
  semantics as `Clear`, `Status`, etc.

## What is staged for follow-ups in #694

- Phase 3+ — `zccache router serve` skeleton, control-plane
  protocol, backend management, FD handoff, router-aware client.

Refs #694, #735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant