mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(hub): add ServerChan task notifications (#515)
* fix(hub): 修复发送后状态显示延迟 * feat(hub): 接入Server酱任务通知 * fix(hub): 仅在会话结束时发送完成通知 * fix(hub): avoid reviving inactive queued sessions * fix(hub): address notification review feedback * fix(hub): expire queued thinking on hub clock * fix(hub): 修复任务通知 review 反馈
This commit is contained in:
@@ -214,6 +214,8 @@ export async function runCodex(opts: {
|
||||
};
|
||||
});
|
||||
|
||||
let crashed = false;
|
||||
|
||||
try {
|
||||
await loop({
|
||||
path: workingDirectory,
|
||||
@@ -236,6 +238,7 @@ export async function runCodex(opts: {
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
crashed = true;
|
||||
lifecycle.markCrash(error);
|
||||
logger.debug('[codex] Loop error:', error);
|
||||
} finally {
|
||||
@@ -243,6 +246,9 @@ export async function runCodex(opts: {
|
||||
if (localFailure?.exitReason === 'exit') {
|
||||
lifecycle.setExitCode(1);
|
||||
lifecycle.setArchiveReason(`Local launch failed: ${formatFailureReason(localFailure.message)}`);
|
||||
lifecycle.setSessionEndReason('error');
|
||||
} else if (!crashed) {
|
||||
lifecycle.setSessionEndReason('completed');
|
||||
}
|
||||
await lifecycle.cleanupAndExit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user