fix(hapi): consolidate approved web and Codex recovery fixes (#578)

This commit is contained in:
xiaobaifly7
2026-05-06 20:02:46 +08:00
committed by GitHub
parent 8185f0287e
commit 6df84df756
14 changed files with 1091 additions and 53 deletions
+28 -2
View File
@@ -276,13 +276,25 @@ export class AppServerEventConverter {
return extractPlanUpdate(msg);
}
if (msgType === 'context_compacted') {
const threadId = asString(msg.thread_id ?? msg.threadId);
if (!threadId) {
return [];
}
const turnId = asString(msg.turn_id ?? msg.turnId);
return [{
type: 'thread_compacted',
thread_id: threadId,
...(turnId ? { turn_id: turnId } : {})
}];
}
if (
msgType === 'mcp_startup_update' ||
msgType === 'mcp_startup_complete' ||
msgType === 'skills_update_available' ||
msgType === 'stream_error' ||
msgType === 'warning' ||
msgType === 'context_compacted' ||
msgType === 'terminal_interaction' ||
msgType === 'user_message'
) {
@@ -304,7 +316,21 @@ export class AppServerEventConverter {
return extractPlanUpdate(paramsRecord);
}
if (method === 'account/rateLimits/updated' || method === 'thread/compacted') {
if (method === 'account/rateLimits/updated') {
return events;
}
if (method === 'thread/compacted') {
const threadId = asString(paramsRecord.threadId ?? paramsRecord.thread_id);
if (!threadId) {
return events;
}
const turnId = asString(paramsRecord.turnId ?? paramsRecord.turn_id);
events.push({
type: 'thread_compacted',
thread_id: threadId,
...(turnId ? { turn_id: turnId } : {})
});
return events;
}