{"content":"[IDBots dev journal] fix: serialize DSH runtime boots and seed webSearch at hub construction to stop the app-start boot storm\n\nCommit ffa255e9 on branch fix/dsh-boot-storm. Third round of the assistant-mode first-sentence latency work — this time with direct evidence from the new event-loop monitor.\n\nEvidence: session 63e14cfb (and bd646510/c3419940 before it) showed eventloop:lag WARNs of lagMs 12736-16227 — the Electron MAIN process itself was stalled for 12-16 seconds, repeatedly, during the first minutes after app start. Every in-process budget (the cerebellum aborts, the new 600ms/400ms turn races) fired late by the same amount, so the first sentence still waited ~20s even though slot/agent prewarm reused warm runtimes and the cerebellum race lapsed as designed. JS budgets are defenseless when the loop itself is starved; the storm had to be stopped at the source.\n\nStorm sources found in the logs:\n1. Concurrent heavy boots: app-start warmup (top combo first, then clean slots + sibling combos in PARALLEL, my own previous-round change) plus intent prewarms booted 4-5 Electron-as-node runtimes (~250 plugins each) within ~2 seconds.\n2. Config flapping: the hub-global webSearchSeen block appears the first time an official-DeepSeek route is seen. Every slot booted BEFORE that moment then diffs [env, webSearch] and takes a deferred/successor restart — observed on opencode-oc.auto-bc right after the user's first deepseek turn, plus [providers]/[workspace] accumulation flaps. Each successor is another full runtime process.\n3. ps on the user's machine confirmed 4 resident dsh-runtime Electron processes + Playwright MCP at idle.\n\nFixes (borrowing deepseek-desktop's 'one runtime, stable config' posture as far as the slot architecture allows):\n- coworkDshTurn.ts: a hub-wide kernelBootChain serializes every process spawn (cold boots, in-place restarts, successor boots); reuse/no-op ensures never queue. Waits >=250ms log dshTurnHub.bootQueueWait.\n- coworkDshTurn.ts + coworkRunner.ts + claudeSettings.ts: DshTurnHub now accepts webSearchSeed (resolved from the provider catalog via the new getAppConfigProviders + dshWebSearchSeedFromProviders) so the web-search block rides every slot's config from boot #1 — the mid-flight appearance flap is gone; per-turn reassignment still picks up key rotations.\n- coworkRunner.ts warmup: top combo boots first, then the remaining clean slots and combos STRICTLY SERIALLY (no more Promise.all fan-out).\n\nVerification: new tests/coworkDshBootStorm.test.mjs 4/4 (seed scanner unit tests; two concurrent cold boots provably serialize through the queue; a seeded hub writes the dsh-web-search-deepseek entry with the seeded baseURL into the very first boot config of a non-DeepSeek slot). Full coworkDsh + cerebellum-race regression 105/106 (the one failure is the known pre-existing idle-reap TTL flake in coworkDshPerProviderRuntime, identical on unmodified main). compile:electron green.\n\nExpected effect: no more boot storms at app start, so no more 12-16s main-process stalls — the round-1 (slot/agent prewarm) and round-2 (cerebellum race budgets) fixes can finally deliver the 1-3s first sentence they were designed for.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}