Skip to content

feat(runtime)!: refuse to open a fresh SQLite store beside a pre-#201 file - #854

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
decision/sqlite-legacy-refuse
Sep 25, 2026
Merged

ScriptedAlchemy merged 3 commits into
mainfrom
decision/sqlite-legacy-refuse

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

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. Now createSqliteStateDriver({ root }).open() from @agent-bundle/runtime/state/sqlite fails with a typed corrupt AgentStateError when 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/-shm sidecars out of the state root, or delete them. The old store is never adopted or migrated. file mode 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: pass
  • pnpm typecheck: pass
  • pnpm lint: pass
  • pnpm test:unit: pass (4,319 tests, 0 failed)
  • rstest --config rstest.integration.config.ts packages/rsc-runtime/tests/state-sqlite-cross-process.test.ts: pass
  • pnpm 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:

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.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c333c80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@agent-bundle/runtime Minor
create-agent-bundle Patch

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T04:16:47.896812Z 3aba525 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .changeset/remove-legacy-sqlite-state.md Outdated
@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@854
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@854
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@854
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@854

commit: 3aba525

@ScriptedAlchemy
ScriptedAlchemy merged commit 184ff02 into main Sep 25, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 25, 2026
@ScriptedAlchemy
ScriptedAlchemy deleted the decision/sqlite-legacy-refuse branch September 25, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant