fix(server): wait for concurrent SQLite writers instead of failing with SQLITE_BUSY - #5134
All clear
All clear
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.
🔍 Agent activity — reasoning, no tool calls
💭 The change is straightforward—I'm adding a PRAGMA statement and a test. For the imports, I'm using namespace imports for the effect modules which aligns with the conventions, and the test imports from the vitest package are standard named imports. The Sqlite.ts imports are from a layer module rather than a Context, so the service boundary namespace import rule doesn't apply here. Looking at the import patterns in the test file, I notice it's importing from Sqlite.ts as a direct import rather than using a namespace import, but the existing convention for similar layer modules like NodeSqliteClient uses namespace imports. The question is whether this violates the service boundary convention, which seems to require namespace imports at service boundaries—though Sqlite.ts exports layers rather than a service tag, so the rule might not apply here. The bigger concern I'm spotting is that the test uses
Effect.promisewith a raw promise that can reject, which could cause a defect rather than a typed error—Effect.tryPromisewould be more appropriate. There's also the spawned child process that isn't being scoped or cleaned up properly, creating a potential resource leak, though that's not explicitly covered in the conventions. The use ofNodeFS.mkdtempSyncoutside of Effect and manual cleanup withEffect.ensuringis acceptable since tests are allowed to use node builtins with diagnostics disabled. Looking at the specifics: thePRAGMA busy_timeoutquery correctly returns a column namedtimeout, andSqlitePersistenceMemorydoesn't require FileSystem since it's in-memory. The layer composition looks fine—Effect.provide(SqlitePersistenceMemory)works because the memory layer has no dependencies, and the first test properly providesNodeServices.layerto the live persistence layer. I don't see any convention violations here, so this should pass the check.
Agent Credits: 41 credits