chore: rebuild CentOS7 release package

This commit is contained in:
shiyue
2026-06-25 21:52:09 +08:00
parent 04dd48deb2
commit c387c92e4b
11 changed files with 924 additions and 34 deletions

View File

@@ -131,6 +131,28 @@ function createCodexAppRuntime(deps = {}) {
return true;
}
function codexAppErrorMessage(value) {
if (!value) return '';
if (typeof value === 'string') return value;
if (typeof value !== 'object') return String(value);
const parts = [];
const directMessage = value.message || value.title || value.detail || value.reason;
if (directMessage) parts.push(String(directMessage));
const error = value.error && typeof value.error === 'object' ? value.error : null;
if (error) {
if (error.message) parts.push(String(error.message));
if (error.code) parts.push(String(error.code));
if (error.type) parts.push(String(error.type));
}
if (value.code) parts.push(String(value.code));
if (value.type) parts.push(String(value.type));
if (parts.length > 0) return [...new Set(parts)].join(' ');
return safeStringifyPreview(value, 2000, { maxDepth: 3, maxArray: 10, maxKeys: 20 });
}
function sendRuntime(entry, sessionId, payload) {
wsSend(entry.ws, { ...payload, sessionId });
}
@@ -652,7 +674,7 @@ function createCodexAppRuntime(deps = {}) {
if (params.turn?.id) entry.turnId = params.turn.id;
entry.turnStatus = params.turn?.status || 'completed';
if (params.turn?.status === 'failed') {
entry.lastError = params.turn?.error?.message || 'Codex App 任务失败';
entry.lastError = codexAppErrorMessage(params.turn?.error) || 'Codex App 任务失败';
}
return { done: true };
}
@@ -662,14 +684,16 @@ function createCodexAppRuntime(deps = {}) {
case 'guardianWarning':
case 'configWarning':
case 'deprecationNotice': {
const message = params.message || params.title || '';
const message = method === 'error'
? codexAppErrorMessage(params)
: (params.message || params.title || '');
if (message) {
if (method === 'error') entry.lastError = message;
if (method === 'error' || shouldShowRuntimeNotice(method, message)) {
sendRuntime(entry, sessionId, { type: 'system_message', message });
}
}
return { done: false };
return { done: method === 'error' };
}
default: