chatccc 0.2.277 → 0.2.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -71,6 +71,13 @@ function resolveCodexEffort() {
|
|
|
71
71
|
// normalizeCodexMessage — Codex 事件 → UnifiedStreamMessage | null
|
|
72
72
|
// ---------------------------------------------------------------------------
|
|
73
73
|
export function normalizeCodexMessage(msg) {
|
|
74
|
+
if (msg.type === "error" && msg.message?.trim()) {
|
|
75
|
+
throw new Error(`Codex turn failed: ${msg.message.trim()}`);
|
|
76
|
+
}
|
|
77
|
+
if (msg.type === "turn.failed") {
|
|
78
|
+
const detail = typeof msg.error === "string" ? msg.error : msg.error?.message;
|
|
79
|
+
throw new Error(`Codex turn failed: ${detail?.trim() || "unknown Codex error"}`);
|
|
80
|
+
}
|
|
74
81
|
// agent_message 只是 Codex 的一条阶段性文本 item。即使内容看起来像完整答复,
|
|
75
82
|
// 后面仍可能继续发出工具调用,因此不能用它关闭 response-stall watchdog。
|
|
76
83
|
if (msg.type === "item.completed" &&
|