fix(runtime): reserve State Root migrations for Host - #4770
Merged
Conversation
Prevent Desktop-owned Work Board and Session copy cleanup stores from changing a Runtime Host State Root schema. Start the Host first, require an already-current schema from Desktop, and advance the compatibility epoch so mixed generations are rejected before domain work. Generated-by: OpenAI Codex
jackwener
approved these changes
Sep 4, 2026
jackwener
left a comment
Member
There was a problem hiding this comment.
Approved at exact head 68a3295a730f059ea97f528b5c33549311a10a71 at the explicit direction of M4n5ter. No technical review was performed as part of this action; M4n5ter requested the approval and accepts responsibility for subsequent handling.
Review notice: This approval was submitted by an automated review agent operated by jackwener and is published at the direction of M4n5ter, who requested this action and is the human accountable for it.
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
English
A newer Desktop process could open the shared
runtime.sqlitebefore a resident managed Runtime Host and implicitly migrate its schema. When the migration removedcore_agent_runs.record_json, the older Host kept running against the changed database and all subsequent Session reads failed.This change makes the Runtime Host the sole schema-migration authority for its State Root:
No database deletion or data repair is involved. Once a matching Host owns the root, it performs the normal schema migration and Desktop opens its shared tables afterward.
中文
问题的根源不是会话数据损坏,而是两个不同版本的进程同时使用同一个
runtime.sqlite:新版 Desktop 会在旧版托管 Runtime Host 仍然运行时抢先迁移数据库。迁移删掉core_agent_runs.record_json后,旧 Host 仍按旧结构查询,于是所有会话加载都开始失败。本次修复把 State Root 的数据库迁移权收回到 Runtime Host:
这里不会删除数据库,也不需要靠清理用户数据恢复。配套 Host 接管 State Root 后会按正常流程完成迁移,随后 Desktop 再打开自己的共享表。
Verification
npm exec -- biome checkon all changed TypeScript filesnpm --workspace @maka/storage run buildnpm --workspace @maka/runtime-host run buildnpm --workspace @maka/desktop run typechecknpm --workspace @maka/desktop run build:mainAI use
Select exactly one:
Tool(s) and scope: OpenAI Codex diagnosed the mixed-generation schema authority failure, implemented the bounded fix, and added regression coverage.
Checklist
Does this PR entail a change in behavior?