Uh oh!
There was an error while loading. Please reload this page.
Stabilize provisional thought labels during streaming - #665
Conversation
8203063 to
3129e86CompareDeploying maple with |
| Latest commit: | 3129e86 |
| Status: | ✅ Deploy successful! |
| Preview URL: | https://feeca148.maple-ca8.pages.dev |
| Branch Preview URL: | https://codex-issue-660-provisional.maple-ca8.pages.dev |
marksftw
commented
Jul 23, 2026
Post-rebase code review is complete. I reviewed the change independently from race/lifecycle, simplicity/privacy, and UX/test-coverage angles, then validated the findings locally. No code changes were warranted. The snapshot/request guards keep older results from overwriting newer labels, lifecycle cleanup remains deterministic, and the implementation stays narrowly scoped without reintroducing persistence or development diagnostics. I also checked the early-failure/no-retry behavior and synthetic same-phase replacement behavior; both are consistent with the intended lifecycle and do not justify additional complexity in this small follow-up. Validation is clean: 214 tests passed, typecheck and formatting passed, lint reported 0 errors (12 existing warnings), and |
Ready for review. Tested and feeling good about the UX for this. Labels are generated quickly. There is a 5 second retry if it fails. And then longer reasoning blocks get an updated label at 15 seconds because they have more understanding by that point. |
AnthonyRonning
left a comment
There was a problem hiding this comment.
Approved. This is a focused, maintainable follow-up that stabilizes provisional thought labels during streaming, including lifecycle and cancellation handling, without adding persistence or unrelated scope. The review found no blocking issues. One minor retry edge case—unchanged reasoning after an early label request failure—can be handled later; it only leaves the generic “Thinking…” state and does not risk stale or incorrect labels. You can merge whenever you are ready.
Uh oh!
There was an error while loading. Please reload this page.
Closes#660
Follow-up to #646 and #650.
Why
Long active reasoning phases could remain on
Thinking...because every streamed reasoning delta invalidated and aborted the in-flight Gemma request before it could return.That strict behavior came from a valid review concern: a result tied to older reasoning must not arrive out of order, overwrite a newer summary, or become the retained fallback. However, treating every transport update as a new authoritative snapshot made provisional labels effectively impossible during continuous streaming. Allowing every timed result to publish solved that starvation but made the label change too often to read comfortably.
This PR uses bounded sampled generations as the compromise: streaming text continues to accumulate, while only deliberate label checkpoints supersede an in-flight request.
What changed
The usual visible progression is now
Thinking...→ early provisional → optional fifteen-second refresh → final label. Prompting, model selection, persistence, privacy boundaries, and label validation are unchanged.Validation
bun test— 206 passingbun run typecheckbun run lint— 0 errors, 12 existing warningsbun run format:checkThe desktop binary was not built.