perf(daemon-client): persistent remote clients re-run the /health probe on every command
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.7k
- Forks
- 304
- Avg merge
- 11h 46m
- Merged PRs (30d)
- 471
Contributor 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
-
mutation-model: indirect-ownership self-test pins a test that stopped reaching scroll-edge-state Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
callstack/agent-device#2547 ·
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
callstack/agent-device#2530 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
-
needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 55/100
callstack/agent-device#2714 ·
-
iOS smoke fails in verify-installed-snapshot-bridge when a cold xcrun probe eats the shared deadline Openneeds-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
callstack/agent-device#2712 ·
All issues in callstack/agent-device
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
0xMiden/bridge-portal#132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·