修复素材导入与资源提交的项目锁争用 (#581)
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
修复 #551:本地素材导入、账户素材提交和资源编辑提交在 conversation.write 短暂持有项目锁时会立即失败。现在复用既有约 10 秒有界等待,并将同步取锁与提交放入阻塞线程池,等待期间异步 runtime 继续响应。 - 项目锁先于账号身份租约,等待后重新验证账号身份、导入权限及原 WritePermit;保留跨进程互斥、权限分类和持锁方诊断。 - 资源资产/版本提交和已完成结果清理保留 operation/project guard,取消异步等待不会提前释放仍在执行的提交互斥。超时保留原 operation、幂等键与 staging,恢复不重复远端生成。 - Runtime 素材导入与 UI workflow 切图登记也接入阻塞池,避免共享导入函数新增等待后阻塞这些调用方。同步更新 AGC 行为规范及共享记忆。 验证:163 项 Rust 定向测试通过,覆盖导入与资源编辑、Direct bridge、Runtime 导入、UI workflow、项目锁恢复和失败分类。包含同进程争用、单线程 runtime 心跳、并行 manifest/revision、账号切换、许可取消、完整超时后原 operation 恢复及取消后的 guard 生命周期。 ```sh cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell -- resource_editor:: commands::agent_asset_import_tests agent::direct_tool_bridge::tests tests::project_lock_recovery project::write_lock agent::runtime_tools::context::asset_import_input_tests ui_editor::agent_tools --test-threads=1 npm run check:rustfmt npm run check:encoding npm run check:doc-index git diff --check ``` 全部上述检查通过。Linux 本地未执行 Windows 专属删除挂起行为测试;未调用真实付费 Provider,远端链路使用既有 mock 测试和已下载账本恢复测试验证。没有 API/DTO/schema 变更或数据迁移。 Closes #551 Reviewed-on: #581 Co-authored-by: lhk <ink29535@proton.me> Co-committed-by: lhk <ink29535@proton.me>
This commit was merged in pull request #581.
This commit is contained in:
@@ -8726,6 +8726,13 @@ CI 上 `background_agent_runtime_recovers_stale_running_before_pending_task` 在
|
||||
- 边界:锁定这些不变量的既有用例(`project_tools` / `command_runtime` / `parallel_actions` / `runtime_state` / `response_stream` / `direct_tool_bridge` / `ui_editor::persistence`)不得为了让锁语义通过而改写;用「同线程自持锁」模拟「另一个写者」的两条用例改为**在另一条线程持锁**,断言语义不变。同进程跨线程重入(持锁链在 `await` / `spawn_blocking` 后于其它线程再取锁)仍会等满预算,出现现场时按 2026-08-27 的既有处置改用 `*_locked` 入口,不放宽判据。
|
||||
- 关联文档:[项目客户端占用锁收敛里程碑](../plans/【里程碑】项目客户端占用锁收敛-2026-09-14.md)、[踩坑记录](pitfalls.md)。
|
||||
|
||||
## 2026-10-01 素材提交复用有界项目锁等待
|
||||
|
||||
- 本地素材导入、账户素材下载后的提交、资源编辑资产/版本提交及已完成结果清理复用既有类型化有界等待,跨进程排他、同线程重入和权限分类保持不变。
|
||||
- 同步等待与事务整体放入阻塞线程池;必须先取得项目锁,再取得平台身份租约,并在等待后验证原 WritePermit。不能在账号互斥锁内等待项目锁,也不能把项目锁 guard 跨线程搬到实际提交线程。
|
||||
- 资源编辑的 operation/project 异步互斥 guard 随阻塞任务持有,调用方取消等待不能提前释放。原账本、operation、幂等键及 staging 继续用于本地恢复,不因锁争用重复远端生成。
|
||||
- 关联:Issue #551;行为与证据见 AGC 实施计划“素材导入与资源提交的项目锁等待”。
|
||||
|
||||
## 2026-09-14 AGC 图片类生成后台化:提交即返回 + 项目内任务账本 + 本地排队
|
||||
|
||||
- 背景:栏目画布图片类入口原先是一条同步 IPC `generate_local_project_asset`,一次调用最长等 35 分钟;提交期间两块生成浮层把 × / 遮罩 / Esc /「取消」全部锁死,用户既关不掉面板也看不到进度。远端图片类生成当时共用 single-flight 输出槽(`standalone_platform_art_generation_runtime_context` 按 `outputPath` 派生 `run_id`)——**同一批次内该槽身份已改为精确动作指纹,见本文件 2026-09-14「放开 AGC 手工图片生成的本地并发」条目。**
|
||||
|
||||
Reference in New Issue
Block a user