fix: stabilize rpg publish and launch

This commit is contained in:
kdletters
2026-05-21 20:20:06 +08:00
parent 224a26d318
commit a9d23a8a44
14 changed files with 614 additions and 82 deletions

View File

@@ -30,6 +30,22 @@
- 验证:`cargo test -p module-custom-world publish_setting_text --manifest-path server-rs\Cargo.toml``cargo check -p spacetime-module --manifest-path server-rs\Cargo.toml`
- 关联:`server-rs/crates/module-custom-world/src/application.rs``server-rs/crates/spacetime-module/src/custom_world.rs``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
## RPG 已发布结果页进入世界不能重复 publish_world
- 现象RPG 草稿发布成功后,按钮文案已变为“进入世界”,但点击仍请求 `POST /api/runtime/custom-world/agent/sessions/{sessionId}/actions` 且 payload 为 `{"action":"publish_world"}`,后端返回 `publish_world is only available during object_refining, visual_refining, long_tail_review or ready_to_publish`
- 原因:按钮文案依据 agent session `stage === 'published'` 切换,但点击处理仍走发布协调路径;如果前端只依赖草稿同步回包判断是否已发布,回包为空或缺少可进入状态时就会继续重复发送 `publish_world`
- 处理:进入世界协调器接收当前 agent session stage当 stage 已为 `published` 时,只调用 `result-view` 回读已发布 profile 并启动运行态,不再调用 `sync_result_profile``publish_world`
- 验证:`npm run test -- src/components/rpg-entry/useRpgCreationEnterWorld.test.tsx`;确认已发布场景下 `syncAgentDraftResultProfile``executePublishWorld` 均未被调用。
- 关联:`src/components/rpg-entry/useRpgCreationEnterWorld.ts``src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
## RPG 点击启动黑屏先查 profile 归一化和角色选择兜底
- 现象:作品详情点击“启动”后页面切到 RPG runtime但用户只看到黑屏或空白DevTools 里可能同时看到旧自动存档 `/api/runtime/save/snapshot` 被主动 cancel。
- 原因:`/custom-world-library` / `/custom-world-gallery` 详情接口可能返回历史或摘要式 `profile`,缺少 `playableNpcs``storyNpcs``landmarks``attributeSchema` 等运行态字段;前端 client 若直接把该对象传给 runtime角色选择首屏会在 `buildCustomWorldPlayableCharacters(profile)` 或后续属性解析处抛错。`save/snapshot (canceled)` 通常是切 runtime 或卸载时 `AbortController` 取消旧自动存档,不是黑屏根因。
- 处理RPG 入口作品库 client 在所有返回 `CustomWorldLibraryEntry<CustomWorldProfile>` 的接口边界统一调用 `normalizeCustomWorldProfileRecord`,并用 `profileId/worldName/subtitle/summaryText` 补齐旧数据缺字段;角色选择页对角色生成异常或空数组回退默认角色,并保留返回按钮/轻量空态;顶层 runtime 懒加载 fallback 不使用纯 `null`
- 验证:`npm run test -- src/services/rpg-entry/rpgEntryLibraryClient.test.ts``npm run test -- src/components/rpg-entry/RpgEntryCharacterSelectView.test.tsx``npm run typecheck`
- 关联:`src/services/rpg-entry/rpgEntryLibraryClient.ts``src/components/rpg-entry/RpgEntryCharacterSelectView.tsx``src/App.tsx``src/components/rpg-runtime-shell/RpgRuntimeShell.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
## Windows provision 下载截断要断点续传而不是回退目标机下载
- 现象:`Genarrative-Server-Provision``Download Provision Tool Archives` 阶段出现 `curl: (18) end of response ... bytes missing`,常见于 `otelcol-contrib_0.151.0_linux_amd64.tar.gz` 等 GitHub release 大文件。