perf(daemon-client): persistent remote clients re-run the /health probe on every command
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli, performance
Research direction
Start in src/daemon-client/daemon-client-lifecycle.ts at ensureRemoteDaemon and trace how persistent clients identify a daemon and handle transport failures. Run the persistent-client benchmark and daemon-client-health-compat.test.ts first. Done means one wire request per command after the initial probe, restart detection still passes, and fresh-process CLI behavior is unchanged.
Written by the indexing model from the issue text.
Description
Problem
ensureRemoteDaemon (src/daemon-client/daemon-client-lifecycle.ts:174) calls readRemoteDaemonHealth on every sendToDaemon, so one proxied command is two round trips:
GET /health
POST /rpc
For a fresh-process CLI that is one probe per process and unavoidable. For a persistent client (the MCP server, the benchmark's persistent-client mode) it is a full extra round trip per command. It matches the ~2.5 round trips per snapshot the #2198 slice-B benchmark measured (persistent-client medians 36 / 93 / 233 ms at 0 / 20 / 80 ms RTT).
Found in #2381 while asserting #2198's round-trip line in #2387; it predates the bridge and is unrelated to it.
Required behavior
A persistent client pays the ADR 0006 health probe once per daemon identity, not once per command. A fresh process still probes before its first command. Re-probe on a transport failure or a changed daemon identity (base URL, token, pid), not on a timer alone.
Completion
- Persistent-client benchmark shows one wire request per command after the first.
- A daemon restart between two commands is still detected (compat and version-skew checks in
daemon-client-health-compat.test.tskeep passing). - Fresh-process CLI behavior unchanged.
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 315
- Avg merge
- 11h 17m
- Merged PRs (30d)
- 536
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
needs-triage refactor
Difficulty 5/5 Over a week Newbie friendliness 25/100
callstack/agent-device#3116 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
callstack/agent-device#3106 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
callstack/agent-device#3105 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
callstack/agent-device#3104 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Doist/todoist-cli#576 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 72/100
vercel-labs/skills#2370 ·
Maintainers usually reply within 1 day
-
🐛 Bug supabase/cli
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day