fix(delegate-task): add exception fallback for cleanup reason and correct test mock status type

This commit is contained in:
YeonGyu-Kim
2026-03-13 13:08:50 +09:00
parent 04b0c6f33c
commit 380889caa3
2 changed files with 4 additions and 1 deletions

View File

@@ -115,7 +115,7 @@ describe("executeUnstableAgentTask cleanup", () => {
manager: mockManager,
client: {
session: {
status: async () => ({ data: { ses_timeout_cleanup: { type: "running" } } }),
status: async () => ({ data: { ses_timeout_cleanup: { type: "busy" } } }),
messages: async () => ({ data: [] }),
},
},

View File

@@ -223,6 +223,9 @@ ${textContent || "(No text output)"}
session_id: ${sessionID}
</task_metadata>`
} catch (error) {
if (!cleanupReason) {
cleanupReason = "exception"
}
return formatDetailedError(error, {
operation: "Launch monitored background task",
args,