Skip to content

[codex] 修复 Akasha 项目记忆设置的线程调用错误 - #777

Merged
kachofugetsu09 merged 1 commit into
mainfrom
fix/akasha-ui-query-scope-20260926
Sep 26, 2026
Merged

kachofugetsu09 merged 1 commit into
mainfrom
fix/akasha-ui-query-scope-20260926

Conversation

@kachofugetsu09

@kachofugetsu09 kachofugetsu09 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

改动

修复创建项目时 Akasha scope.policy.set 报错。去掉同步 UI query 上的 ctx.entrypoint 包装,保留原 UI 和记忆模式。

根因与归属

PluginMobileUiProvider 在事件循环获取并持有注册 child Context 的 captured RuntimeScope,直到线程查询实际结束。额外的 ctx.entrypoint 在工作线程里调用 asyncio.current_task,触发 no running event loop。Core 许可和排空实现保持原样。

验证

  • 临时真实 scenario:PluginManager 安装 ui/projects/akasha,调用 PluginMobileUiProvider.query(真实线程池、MessageLog、OwnerState;仅外部 embedding 使用确定性 fixture)。
  • 修改前复现与生产一致的 no running event loop。
  • 修改后 global / isolated / off 分别完成 scope.policy.set → project.create → scope.policy.get,并由新 ScopePolicies 实例和 projects OwnerState 回读持久记录。
  • pytest -q tests:44 passed,10.64s。
  • 主代码与测试 pyright:0 errors。
  • plugin_boundary、yoyo、control schema、host bridge protocol check 通过;后者使用已有隔离 grpcio-tools 1.78.0 环境。
  • 未新增功能单元测试;按 WORKFLOW 用真实 scenario 验证。
  • GitHub CI:check-and-test 通过(2m34s),plugin-boundary 通过(21s)。
  • 补验 inspector.recent 与 recall.turn:真实 MessageLog 追加 scenario-input 后,经线程池 query 返回该 input_message_id。
  • 独立概念 Gate:reviewer /root/concept_review,model gpt-5.6-terra,reasoning xhigh,head dc3bde3,must-fix=0。复核确认 child permit 会让父 Akasha 在关闭资源前等待物理查询完成;无须调整注册归属或 Core;recall.turn 的冻结 TURN_PROJECTION 依赖仍有效。

部署

用户明确授权合并部署,不做全量备份、不运行迁移。显式计划仅更新 akasha@release。部署后核对 exact main SHA、Root 和真实 UI query。

恢复

源码修改前备份 /tmp/akasha-plugin-before-query-fix-20260926.py;前一线上 release 为 0b1ffab。

已完成部署(2026-09-26)

  • 已合入 main:db215d872d56c35cff15129f458d89535ad0cad8;与审查 head 源码 tree 相同。
  • hua-home installer exit=0、backupRequested=false、migrations=[]。
  • 运行镜像 sha256:e4c5fe362e5d7514feb55f0d81c165ea2768bf435eccb76c21661941f75df92a,镜像 revision 为上述 main。
  • live Root:be7e26eb6dfe9b486c8ea7d49ab78cc48ae73a366a89f702e9f27256896a11bf;64/64 active,无 load_error;只有 akasha@release 的 selected_ref 改变。
  • 线上 Web Unix socket 实际 query:scope.policy.get 返回 global 与三种 choices;scope.policy.set 非法参数返回明确参数错误(安全验证 handler 已运行,未写生产策略);inspector.recent 正常;project.list 正常。
  • 本地真实写入场景覆盖三种模式;没有在生产额外创建测试项目,用户原创建需要刷新后重试。
  • release doctor healthy,Core/Workload healthy,host failed units=0,sessions.db quick_check=ok。

@kachofugetsu09
kachofugetsu09 marked this pull request as ready for review September 26, 2026 05:08
@kachofugetsu09
kachofugetsu09 merged commit db215d8 into main Sep 26, 2026
2 checks passed
@kachofugetsu09
kachofugetsu09 deleted the fix/akasha-ui-query-scope-20260926 branch September 26, 2026 05:08
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