AGC 客户端不再写死 gpt-6-astra 默认模型

- main.rs:DEFAULT_GAME_CREATOR_LLM_MODEL 改用官方占位标识 platform-default
- game-creator.config.json:首启模板 llm.model 同步为 platform-default
- check-config.mjs 与客户端测试同步该口径,去掉已退役模型名的断言
This commit is contained in:
2026-09-24 16:14:43 +08:00
parent 4234a21eed
commit 398564a9f8
5 changed files with 19 additions and 3 deletions
@@ -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,
@@ -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',
@@ -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;
@@ -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"
@@ -297,7 +297,7 @@ test('only displays aliases and persists selection through the native command',
const onReady = vi.fn();
render(<ConversationModelSelect disabled={false} onReady={onReady} />);
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(() =>