feat: add versioned state-store migrations#380
Merged
liujuanjuan1984 merged 2 commits intomainfrom Apr 2, 2026
Merged
Conversation
Collaborator
Author
|
本次 PR 自审结论如下。
风险与边界说明:
Issue 关系检查:
|
Collaborator
Author
|
补充说明:已追加兼容性修复。
|
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.
背景
当前自维护 state store 已经出现显式 schema 演进需求,但升级路径仍停留在
create_all + 隐式补列。本 PR 将其收敛为内建、自动执行的轻量 migration 机制,优先覆盖opencode-a2a自维护的 state tables。State Store Migrations
src/opencode_a2a/server/migrations.pya2a_schema_version记录表,当前 scope 为state_storea2a_interrupt_requests.details_json字段Initialization Path
src/opencode_a2a/server/state_store.py改为统一走显式 migration 初始化路径_add_missing_sqlite_column()/_ensure_state_store_schema()隐式补丁逻辑DatabaseSessionStateRepository与DatabaseInterruptRequestRepository的外部行为不变DatabaseTaskStore的tasks表 schema 生命周期Tests And Docs
tests/server/test_state_store.py新增/扩展以下回归:docs/guide.md增加 migration scope 与 ownership 边界说明./scripts/doctor.shIssue 关联