refactor(storage): effectify Storage service#20132
Merged
kitlangton merged 5 commits intodevfrom Mar 31, 2026
Merged
Conversation
Migrate from promise-based to Effect-based implementation using ServiceMap.Service, TxReentrantLock, and AppFileSystem. Add Zod schemas for migration validation and storage tests.
d00e759 to
7a5dc9b
Compare
Extract repeated dir/target/lock resolution into a single `resolve` helper, removing 3-line boilerplate from each CRUD operation.
Drop Effect.fn wrapper from cached state (runs once, no trace needed). Rename get→lock for clarity, use fnUntraced for internal helper. Add tests for update-on-missing, write-overwrite, remove-noop, list-empty, concurrent reads, and nested keys.
Scope storage tests to unique directories so they do not race other package tests. Disable the file watcher only inside session message server tests on Windows to avoid the Bun watcher crash without breaking watcher-dependent coverage.
Handle invalid migration markers and malformed legacy records without skipping or corrupting migrations. Add focused migration coverage and switch the storage lock cache to RcMap so per-key locks are cleaned up automatically.
h33h
pushed a commit
to h33h/opencode
that referenced
this pull request
Mar 31, 2026
vicary
pushed a commit
to vicary/opencode
that referenced
this pull request
Apr 6, 2026
balcsida
pushed a commit
to balcsida/opencode
that referenced
this pull request
Apr 8, 2026
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
ServiceMap.Service,TxReentrantLock, andAppFileSystemfs/promises+ customLock/Filesystemutilities with Effect'sSynchronizedRefandTxReentrantLockfor concurrent accessTest plan
bun run typecheckpasses across all packages