Files
Genarrative/apps/ai-game-creator-shell/tests/directTurnFailure.test.ts
T
kdletters d4be3dd97a
Project CI / AI game creator shell Rust crates (push) Successful in 3m15s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 4m30s
Project CI / Backend tests (push) Failing after 4m50s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 6m23s
Project CI / Frontend tests (push) Successful in 3m38s
Project CI / Native shell 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
补齐 Claude 上游错误展示与 MCP 并发隔离
前端保留 401/403/408/429/5xx 状态并补回归测试

按项目隔离 Claude MCP 注册表并防止旧回合误停新桥

更新 DirectProject 排障记录
2026-10-03 19:21:18 +08:00

35 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { directTurnFailureNoticeText } from '../src/view/project-development/chat/conversation/directTurnFailure';
describe('DirectProject 上游失败文案', () => {
it.each([401, 403, 408, 429, 500, 502, 503, 504])(
'保留 HTTP %s 的具体原因',
(statusCode) => {
const text = directTurnFailureNoticeText({
type: 'modelCallFailed',
kind: { type: 'upstreamFailed', statusCode, native: null },
detail: `上游 HTTP ${statusCode}`,
});
expect(text).toContain(`HTTP ${statusCode}`);
expect(text).not.toContain('智能创作请求无效');
},
);
it('原生分类优先于 HTTP 状态文案', () => {
const text = directTurnFailureNoticeText({
type: 'modelCallFailed',
kind: {
type: 'upstreamFailed',
statusCode: 429,
native: { type: 'context-window-exceeded' },
},
detail: 'upstream',
});
expect(text).toContain('模型上下文已超限');
expect(text).not.toContain('HTTP 429');
});
});