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,
|
manager: mockManager,
|
||||||
client: {
|
client: {
|
||||||
session: {
|
session: {
|
||||||
status: async () => ({ data: { ses_timeout_cleanup: { type: "running" } } }),
|
status: async () => ({ data: { ses_timeout_cleanup: { type: "busy" } } }),
|
||||||
messages: async () => ({ data: [] }),
|
messages: async () => ({ data: [] }),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -223,6 +223,9 @@ ${textContent || "(No text output)"}
|
|||||||
session_id: ${sessionID}
|
session_id: ${sessionID}
|
||||||
</task_metadata>`
|
</task_metadata>`
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (!cleanupReason) {
|
||||||
|
cleanupReason = "exception"
|
||||||
|
}
|
||||||
return formatDetailedError(error, {
|
return formatDetailedError(error, {
|
||||||
operation: "Launch monitored background task",
|
operation: "Launch monitored background task",
|
||||||
args,
|
args,
|
||||||
|
|||||||
Reference in New Issue
Block a user