From d6c7148507c956000533af1817284b7abdd677cc Mon Sep 17 00:00:00 2001 From: joaomarcos Date: Sat, 5 Sep 2026 16:00:22 -0300 Subject: [PATCH] docs(desktop): record that the merged-tail seed is dormant under the current call ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both callers build the wait in the same synchronous block as `outputTail.attach(child)`, and stream 'data' is asynchronous, so `bufferedOutput()` is always empty at the seed and this block recovers nothing today. Say so at the code, so nobody reads the seed as the live recovery path for a lost READY sentinel — and so the condition that makes it load-bearing again (any await reintroduced between attach and this call, the pre-#100442 ordering) is written down next to the code that depends on it. --- apps/desktop/electron/backend-ready.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/desktop/electron/backend-ready.ts b/apps/desktop/electron/backend-ready.ts index 1adc8a4e59..844fbe1d60 100644 --- a/apps/desktop/electron/backend-ready.ts +++ b/apps/desktop/electron/backend-ready.ts @@ -137,6 +137,19 @@ function waitForDashboardPort( // listener attaches, so no chunk can fall between snapshot and listener. // Scanned with the merged-tail regex, not the line-anchored one: the tail // interleaves both streams and can splice a partial line onto the sentinel. + // + // REACHABILITY — do not mistake this for a hot path. Both callers in + // main.ts (spawnPoolBackend, startHermes) build this wait in the SAME + // synchronous block as `outputTail.attach(child)`, with no `await` + // between them, and stream 'data' is delivered asynchronously. So under + // the current ordering `bufferedOutput()` is always empty here and this + // block recovers nothing — it is a dormant safety net, not a live fix. + // + // It stops being dormant the moment ANY await is reintroduced between + // attach and this call. That was the real ordering before #100442, and it + // is one refactor away from returning: the surrounding region is claim / + // boot-progress / token-handoff code that repeatedly grows awaits. Keep + // the net correct while it is cheap, and keep the tests that pin it. if (!done) { const alreadyBuffered = bufferedOutput() const m = alreadyBuffered ? alreadyBuffered.match(_READY_IN_MERGED_TAIL_RE) : null