fix(delegate-task): add exception fallback for cleanup reason and correct test mock status type
This commit is contained in:
@@ -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: [] }),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user