Dashboardopencode-loreVector worker isolation, fallback, and …

Vector worker isolation, fallback, and graceful shutdown

Category: architecture
Confidence: 1.00
ID: 01a0a149-e59e-7bc9-9459-44577618520e
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1O1uX56bx2edi1N9h
Created: 2026-08-25 00:26:57
Updated: 2026-09-14 18:59:29

Content

Run vector recall/LTM work off-thread so slow SQLite searches cannot block streaming. Test via _setTestVectorWorkerFactory, not real workers. Dispatch/search/read APIs never reject: setup or dispatch failure becomes unavailable, safe equivalent work may run in-process, and timeout returns an empty/sentinel result without rerunning an uninterruptible scan on the main thread. A slow timeout does not permanently break the pool. For shutdown, first set shuttingDown, reject in-flight work, post cooperative shutdown, and await exits before writer close; this releases reader WAL marks needed for TRUNCATE. Race exits against an unrefed forced-termination timer. Make completion idempotent, declare the timer before callbacks can run, clear it on completion, and treat postMessage failure as worker completion.

Move to: