Commit f25f77b
committed
fix(pilotctl,install,daemon-tests): rc5 UX gaps + flaky panic-survival tests
Three UX gaps from the rc4 clean-install flow:
1. macOS install.sh installs a launchd plist (KeepAlive=true), so the
daemon lifecycle is owned by launchd rather than by the PID file
pilotctl writes when it forks. `pilotctl daemon stop` returned
"daemon socket is active but PID file is missing" and refused to
act; SIGTERM would have respawned anyway via KeepAlive.
pilotctl now detects `~/Library/LaunchAgents/com.vulturelabs.pilot
-daemon.plist` and routes start/stop through `launchctl bootstrap
gui/<UID> <plist>` / `launchctl bootout gui/<UID>/<label>`. The
pilotctl-fork path stays as the fallback for Linux + manual setups.
2. `pilotctl send-message <peer> --data ... --wait` would ACK the
outbound but the responder's reply SYN was rejected by the local
trust gate (`SYN rejected: untrusted source`). --wait then timed out
with no actionable signal. The compiled-in trustedagents allowlist
protects this for the agents it covers, but stale entries (a public
agent redeployed under a new node ID) and any public peer not in the
list fall through to the "pub=true → return silently" path.
maybeAutoHandshake's Branch 3 (public peer, not in compiled list)
now runs a best-effort handshake + WaitForTrust(5s) before
returning. Public auto-approve peers finalise mutual trust in
~700-2400 ms; replies pass the local trust gate naturally afterward.
3. install.sh `PILOT_RC=1` hits api.github.com/repos/.../releases. When
the unauthenticated 60/hr limit is exhausted the API returns 403,
the existing code captured TAG="" silently, and the script fell
through to source-build of `main` HEAD with no -ldflags version
stamp — the user thought they got the latest RC but got an
unstamped "dev" binary.
install.sh now:
- accepts `PILOT_RELEASE_TAG=vX.Y.Z-rcN` as an explicit override
(skips the API entirely);
- separates the API body from its HTTP status code so a 403 is
detected explicitly + reported, with a clear suggestion to set
PILOT_RELEASE_TAG or retry in ~1h, rather than silently
degrading to a source build.
Also: pkg/daemon/zz_panic_survival_test.go — the 10 TestL*PanicSurvival
tests all called t.Parallel() while sharing the package-global
recoveredPanicCount counter. resetRecoveredPanicCountForTest() in one
test could wipe the increment of another's recoverLayer mid-assertion,
producing a flaky FAIL ("did not catch nil-packet panic") even though
the panic WAS recovered (CI logs showed recovered_total=1 immediately
before the FAIL). Drop t.Parallel() from all ten; each test is <50ms
so serialisation has no measurable cost.
Verified live on a clean install:
- daemon start/stop round-trip via launchctl, no PID-file error;
- untrust 179172 + send-message list-agents --wait now succeeds
end-to-end with the reply (~2.2 KB directory dump) inline;
- `go test -count=10 -run TestL.*PanicSurvival ./pkg/daemon/` passes.1 parent 9a44092 commit f25f77b
4 files changed
Lines changed: 185 additions & 22 deletions
File tree
- cmd/pilotctl
- pkg/daemon
- tests
- web/public
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
544 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
545 | 567 | | |
546 | 568 | | |
547 | 569 | | |
| |||
2111 | 2133 | | |
2112 | 2134 | | |
2113 | 2135 | | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
2114 | 2188 | | |
2115 | 2189 | | |
2116 | 2190 | | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2117 | 2224 | | |
2118 | 2225 | | |
2119 | 2226 | | |
| |||
2254 | 2361 | | |
2255 | 2362 | | |
2256 | 2363 | | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
2257 | 2390 | | |
2258 | 2391 | | |
2259 | 2392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
| |||
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
129 | | - | |
130 | 126 | | |
131 | 127 | | |
132 | 128 | | |
| |||
151 | 147 | | |
152 | 148 | | |
153 | 149 | | |
154 | | - | |
155 | 150 | | |
156 | 151 | | |
157 | 152 | | |
| |||
170 | 165 | | |
171 | 166 | | |
172 | 167 | | |
173 | | - | |
174 | 168 | | |
175 | 169 | | |
176 | 170 | | |
| |||
184 | 178 | | |
185 | 179 | | |
186 | 180 | | |
187 | | - | |
188 | 181 | | |
189 | 182 | | |
190 | 183 | | |
| |||
200 | 193 | | |
201 | 194 | | |
202 | 195 | | |
203 | | - | |
204 | 196 | | |
205 | 197 | | |
206 | 198 | | |
| |||
226 | 218 | | |
227 | 219 | | |
228 | 220 | | |
229 | | - | |
230 | 221 | | |
231 | 222 | | |
232 | 223 | | |
| |||
285 | 276 | | |
286 | 277 | | |
287 | 278 | | |
288 | | - | |
289 | 279 | | |
290 | 280 | | |
291 | 281 | | |
| |||
310 | 300 | | |
311 | 301 | | |
312 | 302 | | |
313 | | - | |
314 | 303 | | |
315 | 304 | | |
316 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | | - | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | | - | |
147 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
148 | 163 | | |
| 164 | + | |
149 | 165 | | |
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
153 | 169 | | |
154 | 170 | | |
155 | | - | |
| 171 | + | |
156 | 172 | | |
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
160 | 176 | | |
161 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
162 | 182 | | |
163 | 183 | | |
164 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
203 | 224 | | |
204 | 225 | | |
205 | 226 | | |
| |||
0 commit comments