Repository navigation
Conversation
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.
Why
Concurrent normal daemon startup and
hive remote statuscan both observe an uninitialized runtime.sqlite, then race to insert the same schema version. In a real two-process cold-start reproduction, the status process completed migration while the daemon subsequently failed with UNIQUE constraint failed: schema_version.version and exited1.Approach
Wrap the existing complete schema initialization body in the existing database transaction helper. Initial schema DDL acquires the SQLite writer lock before column/version inspection, retaining it through migration markers. Existing nested migration transactions use savepoints. No new lock service, INSERT OR IGNORE, schema alternative or ignored failure.
Validation
New Linux Node24.19.0 checks on2026-10-09 against main f8f1343:
-51 existing focused schema/SQLite/foreign-column/legacy-driver tests passed; pnpm check/build and git diff --check passed
Retained external runnable process/barrier/control diagnostics satisfy current runnable-self-check guidance; no new repository test file. An earlier rollback fixture incorrectly removed an already-applied migration marker; that invalid diagnostic is retained and not treated as a product failure.
Packaging: npm pack fails with ENOENT creating /home/agent/.npm/_cacache on both candidate and fresh main. Default-install and ignore-scripts pack-smoke flows were not run because no package was produced. Full CI invocation excludes package-tarball tests by repository policy. Cross-platform Node22/26/macOS/Windows native/package matrix remains unrun locally. No permissions changed. Contention proof stays within the existing5s SQLite timeout; no unlimited-wait guarantee or provider/production data involved.