Commit Graph

2 Commits

Author SHA1 Message Date
mayor
d0036b0768 fix(beads): handle deprecated Type field in listViaRPC
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 19s
CI / Test (push) Failing after 1m12s
CI / Lint (push) Failing after 22s
CI / Integration Tests (push) Failing after 36s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
The RPC path for List operations was not converting opts.Type to a label,
causing all issues to be returned when the daemon was running. This resulted
in gt mq list showing all beads (including wisps) instead of just merge-requests.

The subprocess fallback path had this conversion, but RPC did not.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:36:43 -08:00
obsidian
55048333c6 perf(rpc): use bd daemon protocol to reduce subprocess overhead
Replace bd subprocess calls in gt commands with daemon RPC when available.
Each subprocess call has ~40ms overhead for Go binary startup, so using
the daemon's Unix socket protocol significantly reduces latency.

Changes:
- Add RPC client to beads package (beads_rpc.go)
- Modify List/Show/Update/Close methods to try RPC first, fall back to subprocess
- Replace runBdPrime() with direct content output (avoids bd subprocess)
- Replace checkPendingEscalations() to use beads.List() with RPC
- Replace hook.go bd subprocess calls with beads package methods

The RPC client:
- Connects to daemon via Unix socket at .beads/bd.sock
- Uses JSON-based request/response protocol (same as bd daemon)
- Falls back gracefully to subprocess if daemon unavailable
- Lazy-initializes connection on first use

Performance improvement targets (from bd-2zd.2):
- gt prime < 100ms (was 5.8s with subprocess chain)
- gt hook < 100ms (was ~323ms)

Closes: bd-2zd.2
2026-01-26 10:33:59 -08:00