Fix desktop health flaps#1028
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | ea93002 | Commit Preview URL Branch Preview URL |
Jun 15 2026, 06:41 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | ea93002 | Jun 15 2026, 06:42 AM |
Cloudflare previewTorn down — the PR is closed. |
Greptile SummaryThis PR fixes supervised daemon health "flaps" — transient slow health responses were causing the desktop to incorrectly show the crash overlay and remove the daemon's manifest. The fix adds a miss counter that requires three consecutive failed health probes before declaring the daemon down, and stops deleting the manifest when the PID is still alive but the health endpoint is momentarily slow.
Confidence Score: 5/5Safe to merge — the changes are narrowly scoped to the supervised-daemon health-check path, the bearer-token security property is still validated by the updated e2e test, and the diagnostics addition is purely additive. All three changed code paths (miss counter, manifest preservation, diagnostics export) are simple and correct. The new e2e scenario exercises the debounce path end-to-end and retains the bearer-token assertion from the test it replaces. The collectFiles function already handles a missing executor-logs directory gracefully. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Timer as setInterval (10 s)
participant Monitor as armSupervisedMonitor
participant Sidecar as attachToSupervisedDaemon
participant Health as isDaemonReachable
participant UI as Main Window
Note over Timer,UI: Normal operation
Timer->>Monitor: tick
Monitor->>Sidecar: attachToSupervisedDaemon()
Sidecar->>Health: GET /api/health (1.5 s timeout x3)
Health-->>Sidecar: 200 ok
Sidecar-->>Monitor: SidecarConnection
Monitor->>Monitor: "supervisedMonitorMisses = 0"
Note over Timer,UI: Transient flap
Timer->>Monitor: tick
Monitor->>Sidecar: attachToSupervisedDaemon()
Sidecar->>Health: GET /api/health - times out
Health-->>Sidecar: false (PID alive, keep manifest)
Sidecar-->>Monitor: null
Monitor->>Monitor: "misses++ (1 < 3) return early"
Timer->>Monitor: tick (miss 3)
Monitor->>Sidecar: attachToSupervisedDaemon()
Sidecar-->>Monitor: null
Monitor->>Monitor: "misses++ (3 >= 3)"
Monitor->>UI: show crash overlay
Note over Timer,UI: Daemon recovers
Timer->>Monitor: tick
Monitor->>Sidecar: attachToSupervisedDaemon()
Sidecar->>Health: GET /api/health
Health-->>Sidecar: 200 ok
Sidecar-->>Monitor: SidecarConnection
Monitor->>Monitor: "supervisedMonitorMisses = 0"
Monitor->>UI: reload original URL
Reviews (1): Last reviewed commit: "Fix desktop supervised daemon health fla..." | Re-trigger Greptile |
Fixes desktop supervised daemon health flaps.