Repository navigation
fix(dashboard): read the served bundle id off the event loop - #13952
Conversation
status_snapshot ran served_bundle_id (resolve + stat + read of static/dist/index.html) inline on the event loop for every WS push, /api/status poll and SSE event. cached_status_snapshot now reads it in one asyncio.to_thread hop and passes it in as a bundle_id kwarg; the default index path is a module constant. Mesh-3886
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 915748f |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (4 items) — 3 justified, 1 harm-free riderIntent: stop the dashboard status path from doing file I/O on the shared event loop — a FIX, grounded in the documented
Counts run: [FIRST-PRINCIPLES-REVIEWED] 915748f |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Problem / Motivation
The dashboard read a file on the event loop every time it sent status.
Each status push (WebSocket frame,
/api/statuspoll, SSE event) builds one snapshot. That snapshot hashed the served frontend file,index.html. The path lookup and the file check ran on the event loop, the one thread every tab and socket shares.Why it matters
A slow disk stalls that one thread. Then every open tab and socket waits too. The lesson and cron counts were already moved off the loop for this reason (#10907). The bundle id was missed.
What changed (motivation → approach → change)
The shared status funnel in
src/kiro_crew/dashboardnow reads the bundle id in one worker-thread hop, then hands it to the snapshot. The check and the read of the file stay in that same hop, so nothing can change between them. The snapshot just prints the value it is given.Backwards compatibility
Compatible: the status payload keeps the same
bundle_idfield and value. A caller that passes nothing gets"", which the frontend already treats as "unknown, never reload".Tests
One new test in
test/test_ws_offload.pychecks the bundle id is read off the loop thread and reaches the snapshot. It fails when the read is put back on the loop.Manual verification
N/A — unit coverage sufficient: the change only moves where one read runs.
Related Issues
Mesh-3886
Pattern harvest
Not generalizable: the rule for this class already exists (
no-blocking-call-on-event-loop); this was one read it did not catch because it sat behind a sync helper.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)