Repository navigation
Description
Problem and impact
A packaged Copilot reply watcher aborted immediately while being re-armed after its normal timeout. A watcher that failed to start cannot provide the promised answer wake. Treating the launch call itself as success would leave a session waiting without an active watcher.
Observed in the signed v1.2.2 darwin-arm64 runtime, using Node v24.19.0 and better-sqlite3 12.11.1. This happened during local activation of the card release in #134, after the watcher changes in #132. The app and existing agent registrations were still on v1.2.2.
Observed sequence
- The exact-row/action watcher completed its normal 30-minute wait with exit 124 and
Agent Inbox watcher timed out. - The coordinator read
pending({project: "agent-inbox"}): no response. The installation row was still blocked on the same action version. board_get({title, watch: true})returned a fresh host-owned launch contract. The coordinator launched that command unchanged, detached, as instructed.- The first startup status read found exit 134 / Abort trap: 6, with the native stack below.
- After another response read and fresh launch contract, a replacement watcher remained running at its startup observation. This is recovery, not evidence that the defect is fixed.
There is one captured crash, not yet a deterministic reproducer. No installation response was discarded or fabricated; the task remains pending. No data loss was observed.
Evidence
The runtime paths and row identifier below are placeholders; the actual invocation used the exact values returned by MCP.
"$RUNTIME/bin/node" "$RUNTIME/dist/watch-cli.js" --row "$ROW_ID" 2 "$DB_PATH"void node::RemoveEnvironmentCleanupHook(Isolate *, CleanupHook, void *)
at ../src/api/hooks.cc:142
Assertion failed: (env) != nullptr
node::Assert(...)
node::RemoveEnvironmentCleanupHook(...)
node::AddEnvironmentCleanupHookInternal(...)
Statement::~Statement() [better_sqlite3.node]
Statement::~Statement() [better_sqlite3.node]
v8::internal::GlobalHandles::InvokeFirstPassWeakCallbacks()
v8::internal::Heap::PerformGarbageCollection(...)
...
Builtins_AsyncModuleEvaluate
...
node::NodeMainInstance::Run()
Abort trap: 6
Relevant entry points: src/watch-cli.ts opens the store before its top-level await; src/watch.ts polls through store APIs; src/store.ts owns database and statement lifetimes. The stack implicates native statement cleanup during garbage collection, but does not yet establish whether the cause is Node, the addon, build compatibility, or application lifetime handling. It also does not establish the cause of previously observed closed MCP transports.
Priority and disposition
High-priority reliability follow-up: a reachable native process crash can interrupt automatic answer pickup. Keep this separate from the already merged/published card-only release; do not patch a signed runtime in place or move a release tag. The replacement watcher is active, and host completion handling still reads pending responses on abnormal exits. The runtime fault itself remains unresolved.
Acceptance criteria
- Obtain an isolated temporary-database reproducer or enough native diagnostics to identify the failure; never use or publish a user's Inbox database as a fixture.
- Exercise the actual packaged Node/native-addon/ESM entry path, including statement cleanup and startup garbage collection where relevant. A source-only happy-path watch test is insufficient.
- Fix the identified cause through a reviewed source/dependency/build change, with no silent fallback, endless respawn loop, or in-place signed-payload mutation.
- Preserve exact row/action targeting, original-project pickup, at-least-once response delivery, explicit timeout behavior, and store-only database access.
- Confirm ordinary timeout/re-arm, response, close, and action-replacement paths remain correct and that a failed launch is never reported as an armed watcher.
- Assess the packaged v1.2.3 runtime as well; this incident alone does not prove it is affected or fixed.
Activity
[-]Packaged reply watcher can abort during native SQLite cleanup[/-][+]Packaged MCP server and reply watcher can abort during SQLite cleanup[/+]shariqh commentedon Sep 6, 2026
Additional evidence from the next watch renewal: two fresh v1.2.2 stdio MCP launches closed before pending could return. The second launch had stderr attached and captured the same Node RemoveEnvironmentCleanupHook env != nullptr assertion, through better-sqlite3 Statement destructors and GC during AsyncModuleEvaluate. The client surfaced MCP error -32000: Connection closed. This directly demonstrates one source of a closed MCP connection; it does not establish the cause of every historical outage.
I stopped retrying the affected executable and used the unchanged installed 1.2.2 entry/native addon with the already-installed Node v24.18.0 as a temporary session-local compatibility fallback. Both that Node and the packaged v24.19.0 report module ABI 137. The existing hook selftest passed against a private temporary database. A real MCP initialize/whoami/pending/board_get sequence then completed, and its returned exact-action watch command was launched unchanged and observed running under Node 24.18.
No host registration, signed runtime file, Claude instruction, or other running session was changed. This is an operational fallback, not a demonstrated permanent fix or proof that the Node version alone is causal. Investigation should compare both executables with the same addon and a GC-sensitive isolated reproducer. The original packaged defaults remain affected and still need a reviewed fix.
fix: rebuild portable runtimes with compatible Node headers
Give the staged-runtime SQLite check enough time on Intel runners (#193)
Gate each packaged Electron on the allocation-driven SQLite check (#135)
Gate each packaged Electron on the allocation-driven SQLite check (#135)
Update Electron to 43.8.0 for four high-severity security fixes (#191)
Merge origin/main (v1.5.0) into the Windows x64 foundation
Adapt the Windows foundation to v1.5's runtime pins and gates
Keep #315's edits clear of the lines PR #102 changes
Build native Windows x64 release folder (#102)
Compile release builds' better-sqlite3 from source, never a prebuild (#…
Retarget Electron to 43.8.3, the newest 43.x release
Update Electron to 43.8.3 for its security fixes (#360)
Re-pin the portable runtime to the Node 24.22.1 security release (#362 …
Merge origin/main (#367) into issue-362-node-24.22.0
Move the portable runtime from the Node 24.18.1 hold to 24.22.1 (#362) (
Move Electron to 43.8.4, which embeds Node 24.22.1 (#371) (#377)