Repository navigation
fix(skills): reopen DB after boot-time Turso close - #413
Merged
EyJunge1 merged 1 commit intoOct 15, 2026
Merged
Conversation
SkillsManager kept a stale Turso handle when migrators called closeConnection on skills.db, breaking registerDbSkills. Detect stale handles via getConnection identity and reset on lifecycle close. Fixes tickernelz#412
5 of 8 tasks
dmr48rus
pushed a commit
to dmr48rus/opencode-mem
that referenced
this pull request
Oct 16, 2026
ported from upstream 832d8f8. getDb() now asks the connection manager whether the cached handle is still the live one and re-initialises when the boot migrator closed or replaced skills.db; closeTursoAndInvalidateCaches resets skillsManager alongside the other caches. Adapted by hand: skills-manager.ts carries our remote/local branches, so the hunk was applied, not cherry-picked.
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.
Summary
SkillsManagerTurso handles when the connection manager reopensskills.dbafter boot migrators callcloseConnection(same pattern asTursoShardManager).skillsManagerincloseTursoAndInvalidateCaches()for the dispose path.closeConnection.Fixes #412
Test plan
bun test tests/skills-manager.test.ts tests/turso-connection-lifecycle.test.ts tests/v2-skills-bridge.test.tsbun run typecheckFailed to load skills for OpenCode registration: database connection is not openafter plugin boot / restartChecklist
main(do not open PRs from commits already onmain)bun testpasses (or N/A)bun run typecheckpasses (or N/A)bun run checkpasses (format + lint + typecheck; or N/A)