Repository navigation
test runtime: agent-hook server tests run on Node (orca #48, slice 1) - #49
Merged
nachumi-a2zoperations merged 1 commit intoNov 15, 2026
Conversation
Root cause of the agent-hooks group of the fork-wide red unit step (31 of the 113 files in #48): the agent-hook server saves last status through node:sqlite in WAL mode and reads it back read-only when it starts (KeyedJsonRowCache, keyed-json-row-cache.ts:137; the test fixture readSavedStatus does the same). Bun's macOS SQLite refuses a read-only open of a closed WAL database: "unable to open database file". Node opens it. A 20-line probe outside Orca shows exactly that (bun 1.4.4: WAL + readOnly FAIL; every other combination OK; Node: all OK). So on a MacBook every server test that restarts the server or reads the saved rows failed under Bun: directly ("unable to open database file"), or as a restored server with no saved state (null attestation, stale status). These tests reach SQLite only through the server, which the import scan in vitest-sqlite-runtime-scan.mjs does not follow, so they stayed on Bun. The fork already knows this bug for the session search index (SQLITE_HARNESSES: "Bun's macOS SQLite refuses a WAL file then"); Linux CI does not hit it. Fix: route src/main/agent-hooks/server/**/*.test.ts to the Node runtime, beside the existing src/main/persistence and src/main/sqlite entries. No product code changes; production never runs on Bun. Test: vitest-node-runtime-files.test.mjs lists every test file under the agent-hook server from disk and asserts each one resolves to the Node runtime. It failed first (93 of 96 on Bun) and passes now. Evidence: the 31 failing files pass under plain Node (207/207). With the fix, all 96 agent-hook server test files pass through the normal runner: 562/562. Refs #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #48 (slice 1 of the fork-wide red unit step: the agent-hooks group, 31 of the 113 files). #48 stays open for the other groups.
Root cause
The agent-hook server saves last status through
node:sqlitein WAL mode and reads it back read-only when it starts (KeyedJsonRowCache,src/main/sqlite/row-cache/keyed-json-row-cache.ts:137; the test fixturereadSavedStatusdoes the same). Bun's macOS SQLite refuses a read-only open of a closed WAL database ("unable to open database file"). Node opens it.These tests reach SQLite only through the server. The import scan (
vitest-sqlite-runtime-scan.mjs) routes a test to the Node runtime only when it imports a SQLite module or a named harness directly, so they stayed on Bun. Every server test that restarts the server or reads the saved rows then failed: either directly, or as a restored server with no saved state (a null attestation, a stale status). The fork already knows this bug for the session search index (SQLITE_HARNESSES: "Bun's macOS SQLite refuses a WAL file then"). Linux CI does not hit it.Fix
One line in
vitest-node-runtime-files.mjs:src/main/agent-hooks/server/**/*.test.tsruns on the Node runtime, beside the existingsrc/main/persistence/**andsrc/main/sqlite/**entries. Product code is unchanged, since production never runs on Bun.Tests
vitest-node-runtime-files.test.mjslists every test file under the agent-hook server from disk and asserts each one goes to the Node runtime. Red before the fix (93 of 96 on Bun), green after.cdfaf808).check-changedon this head: 13/13.