diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_runtime/mod.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_runtime/mod.rs index dc71492c0..53eff6757 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_runtime/mod.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_runtime/mod.rs @@ -4179,10 +4179,18 @@ fn sync_direct_codex_project_file_projection_at( return Err("Codex 返回后没有可登记的游戏文件".to_string()); } update_manifest_task_status_at(root, "code-prototype", GameCreationAppTaskStatus::Completed)?; + let mut version_registered = false; if outputs_changed || manifest_requires_sync { let _lock = acquire_project_write_lock_with_wait(root, "direct-codex.version")?; let version_revision = advance_agent_runtime_project_revision_locked(root)?; - append_agent_game_iteration_version_at(root, version_revision)?; + version_registered = append_agent_game_iteration_version_at(root, version_revision)?; + } + if version_registered { + // 新增的内部版本只落在清单里:这条写入不经过任何工具桥,也就没有任何事件。 + // 必须显式宣告清单失效,否则渲染层的资源投影(「项目版本」卡、发布面板的版本标签) + // 在本回合结束后不会重读清单 —— 版本已经在盘上,用户却看不到新的版本卡。 + // 与工具桥的素材写入同一口径(见 direct_tool_bridge.rs 的 asset-import)。 + emit_game_creator_manifest_invalidated(root, "direct-codex.version"); } Ok(()) } diff --git a/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishPanel.tsx b/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishPanel.tsx index b030fa5e3..8f32bb5b0 100644 --- a/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishPanel.tsx +++ b/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishPanel.tsx @@ -282,6 +282,22 @@ export function GameDistributionPublishPanel({ () => resolveGameCreationAppProjectVersion(manifest), [manifest], ); + /** + * 「项目版本」这一格的说明。标签只有一个来源(`versions[]` 条数),平台线上版本号是 + * 另一套事实:两句都要说清,且不在这里做第二份口径派生。 + */ + const projectVersionHint = useMemo(() => { + const internalCount = manifest.versions?.length ?? 0; + const label = + internalCount > 0 + ? `本次发布标签 = 最新内部版本 v${projectVersion};agent 再改进一次后,下一次发布将是 v${projectVersion + 1}。` + : `这个项目还没有内部版本,本次发布按首版 v${projectVersion}。`; + const platform = + latestVersionNumber > 0 + ? `线上最近提交 v${latestVersionNumber} 是平台侧事实,与本标签互不推导。` + : '第一次发布即第一版。'; + return `${label}${platform}`; + }, [latestVersionNumber, manifest.versions, projectVersion]); const metadataSuggestionRequestRef = useRef(0); const publicationRequestRef = useRef(0); const publicationDraftAppliedRef = useRef(false); @@ -922,7 +938,7 @@ export function GameDistributionPublishPanel({ /> - {`来自 AGC 内部版本(版本 ${projectVersion}):每次智能体修订追加一个内部版本,发布标签随之推进;${latestVersionNumber > 0 ? `线上最近提交 v${latestVersionNumber} 是平台侧事实,与本标签互不推导。` : '第一次发布即第一版。'}`} + {projectVersionHint}