Nimblesite / Nimblesite/SharpLsp
Sidecar protocol hardening: response-id correlation + health-check lock race
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 132
- Forks
- 5
- Avg merge
- 6h 24m
- Merged PRs (30d)
- 27
Description
From the multi-agent Windows-robustness audit.
-
No response-id validation (
src/sidecar/manager.rsrequest): the response envelope's id is never checked against the request id. Any code path that abandons an exchange mid-stream desyncs the protocol and hands a stale frame to the next caller. The request-timeout fix ([SIDECAR-REQUEST-TIMEOUT]) poisons the transport on timeout, which removes the known abandonment path, but defense-in-depth wantsresponse.id == idverified, with a hard reconnect on mismatch. -
Health-check TOCTOU (
src/sidecar/manager.rshealth_loop): the loop try_locks the transport, drops the guard, then callshealth_check— a request can grab the transport in between, making the 2s ping race a slow-but-healthy request. Also "a busy lock proves the sidecar is alive" only proves a request is in flight, not that it is progressing (now mitigated by per-request budgets, but the monitor could track lock-hold duration instead of skipping).
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start in src/sidecar/manager.rs, reading the request and health_loop functions together with the transport locking and timeout behavior described in the issue. Trace how request IDs and the transport guard are handled, then verify that mismatched responses trigger reconnect behavior and that health checks cannot race with requests or mistake a stalled request for a healthy sidecar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100