From 398564a9f8939967054ca39b125e3c769a3fbd6d Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Thu, 24 Sep 2026 16:14:43 +0800 Subject: [PATCH] =?UTF-8?q?AGC=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=86=99=E6=AD=BB=20gpt-6-astra=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main.rs:DEFAULT_GAME_CREATOR_LLM_MODEL 改用官方占位标识 platform-default - game-creator.config.json:首启模板 llm.model 同步为 platform-default - check-config.mjs 与客户端测试同步该口径,去掉已退役模型名的断言 --- apps/ai-game-creator-shell/game-creator.config.json | 2 +- apps/ai-game-creator-shell/scripts/check-config.mjs | 9 +++++++++ apps/ai-game-creator-shell/src-tauri/src/main.rs | 4 +++- .../src-tauri/src/tests/configuration.rs | 5 +++++ .../tests/conversationModelSelect.test.tsx | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/game-creator.config.json b/apps/ai-game-creator-shell/game-creator.config.json index 3c0005da3..4aa61279a 100644 --- a/apps/ai-game-creator-shell/game-creator.config.json +++ b/apps/ai-game-creator-shell/game-creator.config.json @@ -6,7 +6,7 @@ "visibleModels": [], "apiKey": "", "baseUrl": "https://dev.genarrative.world/gpt/v1", - "model": "gpt-6-astra", + "model": "platform-default", "apiKind": "openai_responses", "reasoningEffort": "max", "stream": true, diff --git a/apps/ai-game-creator-shell/scripts/check-config.mjs b/apps/ai-game-creator-shell/scripts/check-config.mjs index b22a44081..6b2c74b13 100644 --- a/apps/ai-game-creator-shell/scripts/check-config.mjs +++ b/apps/ai-game-creator-shell/scripts/check-config.mjs @@ -1497,6 +1497,15 @@ if (defaultAppConfig.llm?.apiKey !== '') { throw new Error('AI game creator shell default llm.apiKey must stay empty'); } +// 首次启动模板必须写入官方路由占位模型(与 config.rs 的 +// OFFICIAL_LLM_ROUTER_DEFAULT_MODEL 同源):钉死具体上游模型名会随上游目录 +// 变动失效,留空则首启配置不合法。 +if (defaultAppConfig.llm?.model !== 'platform-default') { + throw new Error( + 'AI game creator shell default llm.model must stay the official route placeholder', + ); +} + if (defaultAppConfig.agentMode !== 'codex_app_server') { throw new Error( 'AI game creator shell default agentMode must be codex_app_server', diff --git a/apps/ai-game-creator-shell/src-tauri/src/main.rs b/apps/ai-game-creator-shell/src-tauri/src/main.rs index 7175acf53..061c90877 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/main.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/main.rs @@ -1457,7 +1457,9 @@ const GAME_CREATOR_AGENT_MODE_CODEX_CLI: &str = "codex_cli"; const GAME_CREATOR_AGENT_MODE_PROVIDER: &str = "provider"; const GAME_CREATOR_APP_CONFIG_SCHEMA_VERSION: &str = "game-creator-config.v2"; const DEFAULT_GAME_CREATOR_LLM_BASE_URL: &str = "https://dev.genarrative.world/gpt/v1"; -const DEFAULT_GAME_CREATOR_LLM_MODEL: &str = "gpt-6-astra"; +// 默认模型不再写死具体上游模型名:正式构建锁定官方路由, +// 未选择平台目录模型时该占位标识表示“跟随平台默认”(与 config.rs 同源)。 +const DEFAULT_GAME_CREATOR_LLM_MODEL: &str = OFFICIAL_LLM_ROUTER_DEFAULT_MODEL; const DEFAULT_GAME_CREATOR_LLM_API_KIND: &str = "openai_responses"; const DEFAULT_GAME_CREATOR_LLM_REASONING_EFFORT: &str = "high"; const DEFAULT_GAME_CREATOR_LLM_CONTEXT_WINDOW_TOKENS: u64 = 128_000; diff --git a/apps/ai-game-creator-shell/src-tauri/src/tests/configuration.rs b/apps/ai-game-creator-shell/src-tauri/src/tests/configuration.rs index 121354839..4f7b446ad 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/tests/configuration.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/tests/configuration.rs @@ -554,6 +554,11 @@ fn canonical_agent_reasoning_effort_defaults_are_exhaustive_and_auditable() { template.llm.as_ref().and_then(|llm| llm.max_retries), Some(DEFAULT_GAME_CREATOR_LLM_MAX_RETRIES) ); + assert_eq!( + template.llm.as_ref().and_then(|llm| llm.model.as_deref()), + Some(DEFAULT_GAME_CREATOR_LLM_MODEL), + "首次启动模板必须写入官方路由占位模型,不能钉死具体上游模型名" + ); assert!( template.agent_llm.unwrap_or_default().is_empty(), "bundled template must not persist canonical defaults as explicit overrides" diff --git a/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx b/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx index c7441a14f..7e9fa6f87 100644 --- a/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx +++ b/apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx @@ -297,7 +297,7 @@ test('only displays aliases and persists selection through the native command', const onReady = vi.fn(); render(); await screen.findByRole('button', { name: '对话模型' }); - expect(screen.queryByText('gpt-6-astra')).toBeNull(); + expect(screen.queryByText('quality')).toBeNull(); fireEvent.click(screen.getByRole('button', { name: '对话模型' })); fireEvent.click(screen.getByRole('option', { name: '快速' })); await waitFor(() =>