feat(runtime)!: refuse to open a fresh SQLite store beside a pre-#201 file - #854
Conversation
🦋 Changeset detectedLatest commit: c333c80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3aba525802
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
commit: |
Summary
Owner decision. #837 dropped adoption of the pre-#201 SQLite filename (
<sanitized id>-<12 hex of utf8(id)>.sqlite), so a store under that name was ignored and an empty store opened beside it with no warning. NowcreateSqliteStateDriver({ root }).open()from@agent-bundle/runtime/state/sqlitefails with a typedcorruptAgentStateErrorwhen the old-name file exists and the current-name file does not. The error names the old file and tells the user to move it and its-wal/-shmsidecars out of the state root, or delete them. The old store is never adopted or migrated.filemode and roots that already have a current-name store are unchanged.packages/rsc-runtime/src/state/sqlite.ts: detection and refusal in "resolve storage", before any directory or database is created.packages/rsc-runtime/tests/state-sqlite.test.ts: the refusal, that nothing new is created, that the old file is untouched, a fresh open once the file is removed, and that a current store wins over an old file beside it.website/docs/{en,zh}/reference/runtime-environment.mdx: replaces "old files are ignored" with the refusal and the move-or-delete recovery..changeset/refuse-pre201-sqlite-store.md(minor); also rewords the still-pending refactor(runtime): delete legacy SQLite state adoption #837 changeset so the release notes don't say a store opens beside the old file.Local gate (branch contains current origin/main 78d75f2)
Code on c333c80 (the last commit only rewords a changeset):
pnpm build: passpnpm typecheck: passpnpm lint: passpnpm test:unit: pass (4,319 tests, 0 failed)rstest --config rstest.integration.config.ts packages/rsc-runtime/tests/state-sqlite-cross-process.test.ts: passpnpm docs:site:build: pass (language parity OK, 0 broken links)Review
Independent change-risk review (Claude Opus 5.5) found no material issues. Two low notes:
corruptis a loose label for an unsupported old file. Kept, because refactor(runtime): delete legacy SQLite state adoption #837 already usescorruptfor old-format SQLite storage and the message names the cause and the fix.Codex bot P2 (the changeset should describe the refusal): it reviewed 3aba525, before the dedicated changeset landed. Addressed by
.changeset/refuse-pre201-sqlite-store.md; replied and resolved.