补齐运行态终态错误正文
保留 terminal-unknown 与原生分类后的连接状态和上游消息 新增客户端错误正文回归用例
This commit is contained in:
@@ -393,7 +393,7 @@ export function projectRuntimeVisibleError(
|
||||
}
|
||||
}
|
||||
if (visibleMessage.includes('codex-app-server-terminal-unknown:')) {
|
||||
return `${subject}服务或网络在执行中断开,最终状态未知;请先检查项目文件是否已修改,再决定是否重试`;
|
||||
return `${subject}服务或网络在执行中断开,最终状态未知;请先检查项目文件是否已修改,再决定是否重试${runtimeFailureDetail(message) ?? ''}`;
|
||||
}
|
||||
const directCodexDetail = directCodexFailureDetail(visibleMessage);
|
||||
if (directCodexDetail) {
|
||||
@@ -415,7 +415,7 @@ export function projectRuntimeVisibleError(
|
||||
!retryAttemptText ||
|
||||
!maxRetriesText
|
||||
) {
|
||||
return `${subject} 执行失败,请稍后重试`;
|
||||
return `${subject} 执行失败${runtimeFailureDetail(message) ?? ',请稍后重试'}`;
|
||||
}
|
||||
const httpStatus = Number.parseInt(httpStatusText, 10);
|
||||
const retryAttempt = Number.parseInt(retryAttemptText, 10);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { projectRuntimeVisibleError } from '../src/features/agent-runtime/model';
|
||||
|
||||
describe('Agent Runtime 错误正文', () => {
|
||||
it('终态未知时保留连接层的具体 detail', () => {
|
||||
const text = projectRuntimeVisibleError(
|
||||
'codex-app-server-terminal-unknown: HTTP 503 upstream overloaded;https://provider.example/private',
|
||||
'陶泥儿智能创作',
|
||||
);
|
||||
|
||||
expect(text).toContain('HTTP 503');
|
||||
expect(text).toContain('upstream overloaded');
|
||||
expect(text).not.toContain('provider.example');
|
||||
});
|
||||
|
||||
it('原生分类映射不吞掉后续的状态和错误正文', () => {
|
||||
const text = projectRuntimeVisibleError(
|
||||
'provider failed kind=codex-app-server-unauthorized status=401 detail=invalid token',
|
||||
'陶泥儿智能创作',
|
||||
);
|
||||
|
||||
expect(text).toContain('鉴权失败');
|
||||
expect(text).toContain('status=401');
|
||||
expect(text).toContain('detail=invalid token');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user