GeezerVison is showing github.com — feat(session): add storage interface for pluggable session backends by ryanjwong · Pull Request #15922 · anomalyco/opencode
Conversation
ryanjwong
commented
Mar 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
This adds a typed storage contract for session persistence, wraps SQLite behind that contract, and makes the contract async-compatible so non-SQLite providers can be added more easily.
Changes included:
- Added
SessionStore + SessionStoreTx interfaces in packages/opencode/src/session/store.ts, with operation groups for sessions/messages/parts/todos/permissions.
- Added schema-derived insert/select types (
SessionInput, SessionRow, etc.).
- Added
Asyncable<T> return support across the store interface (use, transaction, effect, and tx methods).
- Added
SqliteSessionStore adapter in packages/opencode/src/session/store.sqlite.ts that wraps Database.use, Database.transaction, and Database.effect.
- Routed core write paths through the adapter:
Session.updateMessage, Session.removeMessage, Session.removePart, Session.updatePart
Todo.update and Todo.get (now async to align with async-capable store)
- Exported store types and sqlite adapter from
packages/opencode/src/session/index.ts.
This remains incremental: runtime behavior should stay equivalent while introducing a real, async-ready boundary for follow-up backends.
How did you verify your code works?
- Installed Bun (
1.3.10) in this environment
- Ran
bun install at repo root
- Ran
bun run typecheck in packages/opencode
- Pushed branch successfully; pre-push hook ran
bun turbo typecheck and passed
Screenshots / recordings
N/A (no UI changes)
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|