fb130d1847
Project CI / AI game creator shell Rust lane 1/2 (push) Failing after 57s
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust crates (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 smoke (push) Has been cancelled
后台模型目录增加 codex/cc 执行模式绑定,旧目录缺省兼容 Codex AGC 客户端按模型绑定路由 Codex app-server 或 Claude Agent SDK sidecar 随包携带 Node runtime、Claude Agent SDK 与匹配平台 Claude runtime 补充模型配置、客户端选择、运行时适配、MCP 取消和定向测试 同步 AGC 模型配置规范、里程碑计划与共享决策记录
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
// @vitest-environment jsdom
|
|
import { beforeEach, expect, test, vi } from 'vitest';
|
|
|
|
import { resolveTauriInvoke } from '../src/app/tauri';
|
|
import { loadClientLlmModels } from '../src/services/clientApi';
|
|
|
|
vi.mock('../src/app/tauri', () => ({ resolveTauriInvoke: vi.fn() }));
|
|
|
|
const invoke = vi.fn();
|
|
|
|
beforeEach(() => {
|
|
vi.clearAllMocks();
|
|
vi.mocked(resolveTauriInvoke).mockReturnValue(invoke);
|
|
});
|
|
|
|
test('模型目录缺少 agentMode 时默认使用 codex,同时保留官方 cc 路由', async () => {
|
|
invoke.mockResolvedValue({
|
|
defaultModelId: 'quality',
|
|
models: [
|
|
{ id: 'quality', displayName: '高质量' },
|
|
{ id: 'claude', displayName: 'Claude', agentMode: 'cc' },
|
|
],
|
|
revision: 1,
|
|
});
|
|
|
|
await expect(loadClientLlmModels()).resolves.toEqual({
|
|
defaultModelId: 'quality',
|
|
models: [
|
|
{ id: 'quality', displayName: '高质量', agentMode: 'codex' },
|
|
{ id: 'claude', displayName: 'Claude', agentMode: 'cc' },
|
|
],
|
|
revision: 1,
|
|
});
|
|
expect(invoke).toHaveBeenCalledWith('load_game_creator_llm_models');
|
|
});
|