Repository navigation
Commit 8014af7
gluck
fix(cli): show a turn as running when it starts, not when it speaks
In transcript mode the status row said idle from submit until the model's
first token. Measured against a live aria, with a watcher that only
subscribes: the daemon broadcast the committed question 34.5ms after
submit and the first content delta at 2263.6ms. Two point two seconds of
honest signal, thrown away, and much worse on a cold turn.
Two separate causes.
THE GUARD WAS ONE LINE TOO WIDE. armThinking does two things, and they
have different owners. t.status.beginTurn() sets state the PAGER paints,
in its own footer, through footerStanza. t.in.OpenThinking() opens a live
region belonging to the inline renderer alone, which must not paint while
the pager holds the screen. f28e6e1 guarded both on t.tr.active and its
comment says why: "No-op in the pager (it renders the footer itself)".
That is true of the second half and false of the first, because what the
pager renders the footer FROM was inside the guard. So the guard is kept
and split rather than deleted: status is set in both views, the incipit
region stays inline-only.
THAT ALONE FIXES ONLY THE SENDER. A prompt typed into the pager goes
through commandSend, which never called armThinking; a listener never
submits at all; a queued prompt begins its turn long after its own call
returned. All three learn from the wire, so the wire is what arms them.
Client gains OnTurnOpen, beside OnClosed, OnLive and OnMetrics, fired
when a turn takes the open slot.
It belongs in the client and not in the caller because "which turn owns
the open slot" is already decided there, once, in claimsOpen, and that
file warns in its own comments what a second opinion computed upstream
costs: three branches disagreeing about the buffer is what let a page of
history destroy a live turn. Recomputing the same predicate in the CLI
would be that mistake again. Catch-up history arrives through Merge,
which fires no callbacks, and claimsOpen refuses a sealed part, so
neither reading old turns nor a mid-turn reconcile lights the spinner.
The callback is edge triggered on the turn id, since the inquiry rides
along on later frames of the same turn.
Four tests in internal/cli/thinking_armed_test.go, verified to fail
without the fix: three fail with the exact symptom, and the fourth is the
sealed-frame guard, which must pass either way.
Also documents the trap that ate the first draft of that file.
thinking_arm_test.go compiles only on GOARCH=arm, so it was not a test
that failed, it was a file that did not exist, and build, vet and test
were all clean while it did not run.1 parent d718039 commit 8014af7
4 files changed
Lines changed: 194 additions & 4 deletions
File tree
- internal
- cli
- livelog/aria
- skills/figaro/contributing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
| |||
305 | 317 | | |
306 | 318 | | |
307 | 319 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
311 | 333 | | |
| 334 | + | |
312 | 335 | | |
313 | 336 | | |
314 | 337 | | |
315 | 338 | | |
316 | | - | |
317 | 339 | | |
318 | 340 | | |
319 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
53 | 70 | | |
54 | 71 | | |
55 | 72 | | |
| |||
266 | 283 | | |
267 | 284 | | |
268 | 285 | | |
| 286 | + | |
| 287 | + | |
269 | 288 | | |
270 | 289 | | |
271 | 290 | | |
| |||
293 | 312 | | |
294 | 313 | | |
295 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
296 | 322 | | |
297 | 323 | | |
298 | 324 | | |
| |||
430 | 456 | | |
431 | 457 | | |
432 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
433 | 464 | | |
434 | 465 | | |
435 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
249 | 275 | | |
250 | 276 | | |
251 | 277 | | |
| |||
0 commit comments