Repository navigation
Done
Labels
Description
fleet gh cache daemon: sandbox runs no local daemon (the ensure step the design doc describes does not exist); laptop daemon alive but unsupervised
Filed 2026-11-23 (diagnosis lane FLEET-GH-DAEMON). Design of record: doc/agents/gh-cache-daemon.md (code#10742) — the rule is a local cache daemon runs at all times on any host that runs fleet gh, and the doc states ~/tools/init-ensure.sh keeps the sandbox one running. That claim does not match the installed estate.
Symptom / measured impact (2026-11-23 evening)
- Multiple lanes (AUDIT-7 first) found
fleet gh apifrom the Muse sandbox hanging / falling back; work routed around it via the GitHub App route (~/tools/gh-post) all evening. - Reproduced tonight from the sandbox:
fleet gh cache-status→ both addresses DOWN; a timedfleet gh api rate_limittook 26.7s with the stderr noticeno cache daemon answered (tried 127.0.0.1:4802, 100.99.113.103:4802 …); resolving in-process. In-process resolution is the slow path by design (~120s per call when the secrets broker is cold, per the design doc's 2026-11-22 measurement).
Diagnosis (verified on both hosts tonight)
- Sandbox: no local daemon — the actual defect. Nothing listens on 127.0.0.1:4802 in the sandbox. Grep finds no
cache-servestep in~/tools/init-ensure.sh,~/tools/init.sh, the laptop-channel heal script, or the canonicalscripts/boot-hook/init.shin hatch-personal — the ensure leg the design doc describes was never implemented (or was lost). Nothing starts the daemon at boot and nothing revives it. - Sandbox → laptop fallback is unreachable by construction. The client's second address, 100.99.113.103:4802, fails from the sandbox with
Operation not permitted (os error 1)— the sandbox cell's egress policy denies the direct tailnet connect before it leaves the host (same EPERM class as the tailnet findings on Broker-stack performance under load: queue reads 8-28s, fleet gh +5s vs direct, DERP-only tailnet path (490-873ms) #13894). The laptop daemon also binds loopback only (default bind), so the tailnet leg could not be served even with egress granted. Per the design doc this leg is a fallback, not the plan — the plan is a local daemon per host. - Laptop daemon: alive and healthy — not down.
fleet gh cache-servepid 251919, started 2026-11-23 19:36 CST,cache-statuson the laptop:127.0.0.1:4802 UP, entries=11, hits=55018, misses=355, uptime≈3h46m. Laptop-local calls are fast (0.59s measured). The evening's laptop-side slowness reports predate the 19:36 start or were other seats' fallbacks. Weaknesses, recorded for follow-up: it is unsupervised — an ad-hoc child of an OpenCode session shell (no systemd user unit; it dies with that session tree and nothing restarts it), and it runs a since-replaced binary (exe shows(deleted)after the fleet-static-74eee89 flip).
Fix applied (sandbox, tonight)
Started the sandbox daemon with the design doc's own pattern: setsid nohup fleet gh cache-serve (log ~/logs/gh-cache-daemon.log on the sandbox). Verified:
fleet gh cache-statusin the sandbox:127.0.0.1:4802 UP(entries=10 after warm-up, hits accumulating).- Timed warm reads from the sandbox:
fleet gh api rate_limit→ 1.45s and 1.47s (was 26.7s in-process). No fallback notice.
The laptop daemon was deliberately not restarted: it is healthy and serving production lane traffic; a restart only buys a binary refresh at the cost of a cold cache mid-evening.
Follow-ups (the durable fixes)
- Implement the missing ensure leg: add the gh cache daemon to the sandbox init-ensure pattern (pgrep/port gate,
setsid nohupspawn — same shape as the sandbox-local secrets broker leg), in the canonical scripts in hatch-personal as well as the installed copies, so the daemon survives VM recycles. Until then, the manually started daemon dies with the sandbox. - Supervise the laptop daemon: a systemd user unit (or the laptop equivalent of the ensure pattern) instead of an OpenCode session's ad-hoc child; pick up current binaries on flip.
- Optional: correct
doc/agents/gh-cache-daemon.md's init-ensure claim once (1) lands, so the doc stops asserting a keeper that doesn't exist.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T05:25:54Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "archer",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 24, 2026
CODE-5180
developing-today-fleet commentedon Nov 24, 2026
Fix record — GH-DAEMON-FIX lane, 2026-11-24
Drew's order ("fix the daemon") executed. Two of the three follow-ups are landed and proven live; the third (the doc correction) is fully prepared below and its landing is blocked only by repo mechanics in this lane — see the end.
1. Sandbox init-ensure leg — DONE, proven
~/tools/init-ensure.shnow carries a gh credential-cache daemon leg, in the same ensure pattern as the session proxy and the sandbox-local secrets broker: pgrep/port gate on 127.0.0.1:4802, flock,setsid nohupspawn from the test-exec'd fleet binary (FLEET_BIN_OK— the #12498 lesson), best-effort, log~/logs/gh-cache-daemon.log. It runs after the secrets-broker leg because the daemon mints through the secrets chain. (init-ensure.shis~/tools-only by the boot-hook README's own statement —init.sh/nix-ensure.share the scripts with canonical copies in hatch-personal, and neither carries these prelude legs — so there was no canonical copy to mirror; the README documentation bullet is prepared below.)Kill-and-ensure proof (2026-11-24 ~06:05–06:07 CST):
gh apiread of this issue in 2.3 s.~/tools/init-ensure.sh(0.59 s, exit 0): new daemon pid 7051 (/home/hatch/tools/fleet gh cache-serve) listening on 127.0.0.1:4802.fleet gh cache-statusUP (hits recorded).init-ensure.shrun left pid 7051 untouched.2. Laptop daemon supervision — DONE, proven
The unsupervised OpenCode-session child (pid 251919, exe
/home/user/.local/bin/fleet (deleted), parent bash 251918 underopencode serve) is replaced by a systemd user unit in the estate's normal shape (mirroringmcpx-bridge.service):~/.config/systemd/user/fleet-gh-cache.service—ExecStart=%h/.local/bin/fleet gh cache-serve,Restart=on-failure,RestartSec=5,WantedBy=default.target; enabled. File sha2563524c2e5baf79cad4be974562458245500622d0e343989e11f18bdc2c0813fcd.cache-status, so a supervised-form daemon was serving before the old process was touched. Old pid 251919 was then killed by exact PID (its bash parent exited with it), the permanent unit started immediately, and the transient was stopped only after the permanent one verified.fleet-gh-cache.serviceactive/running, MainPID 218796, listening on 127.0.0.1:4802 with the current (non-deleted) binary. Timedfleet gh apireads on the laptop through it: 1.09 s / 1.20 s. The cold cache refilled within seconds (entries=10 at first status check).3. Design-doc correction — PREPARED, landing blocked in this lane
For
doc/agents/gh-cache-daemon.md, "The rule" section — replace the sandbox sentence (which currently asserts the ensure leg as fact) with:And in hatch-personal
scripts/boot-hook/README.md§6, after the "Session proxy" bullet:Why not landed here: every repo-write route from this lane failed or was barred — the sandbox code clone's
git fetchdied writing pack files (Operation not permittedon.git/objects/pack/...), a second sandbox clone's fetch stalled the same way, the hatch-personalgit worktree addfailed mid-checkout (unable to write file .../packet-code-2818-coverage.json, index reset failed), and the laptop worktree route (~/git/wt-gh-daemon-doc, brancharcher/gh-daemon-doc-14099, created at origin/main a8dd96c) was flagged by a platform execution-risk check, after which this lane did not run git or edits inside it. Per the standing route ruling, the two text landings above belong to a laptop-local OpenCode session, which can apply them verbatim and open the PRs; the laptop worktree is still there for it (or it can start its own).Nothing else is outstanding on this issue: the daemon now self-heals on the sandbox within one init-ensure run and is supervised on the laptop.
dezren39 commentedon Nov 24, 2026
Record for code#14099 (both prepared texts applied verbatim from comment 7123671575). Neither PR is merged; Archer merges.
1. developing-today/code: PR #14125 — #14125
Branch
archer/gh-daemon-doc-14099(worktree~/git/wt-gh-daemon-doc).Confirmed: only the "## The rule" paragraph changed. The following "Note the secrets broker..." sentence is untouched.
2. dezren39/hatch-personal: PR #82 — https://github.com/dezren39/hatch-personal/pull/82
Branch
archer/gh-daemon-readme-14099(worktree~/git/wt-gh-daemon-readme, cut fromorigin/mainof~/hatch-personal).Confirmed: a single bullet inserted after the "Session proxy (laptop-agent broker)" bullet. Nothing else changed.
dezren39 commentedon Nov 24, 2026
Triage verdict (lane code-j, 2026-11-24): resolved in substance. Sandbox ensure leg proven (kill-and-ensure), laptop daemon supervised by a systemd user unit (fix record comment), and the design-doc correction is merged as PR #14125. Closing as implemented. Refs #14158.
dezren39 commentedon Nov 24, 2026
Closed as implemented.