Skip to content

Commit fe37ce2

Browse files
committed
add more debug logs after api call failures
1 parent 8e10c72 commit fe37ce2

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

packages/cli-v3/src/entryPoints/managed-run-controller.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,14 @@ class ManagedRunController {
242242

243243
if (!response.success) {
244244
console.error("[ManagedRunController] Heartbeat failed", { error: response.error });
245+
246+
this.sendDebugLog({
247+
runId: this.runFriendlyId,
248+
message: "heartbeat: failed",
249+
properties: {
250+
error: response.error,
251+
},
252+
});
245253
}
246254
},
247255
intervalMs: this.heartbeatIntervalSeconds * 1000,
@@ -624,6 +632,14 @@ class ManagedRunController {
624632
if (!continuationResult.success) {
625633
console.error("Failed to continue execution", { error: continuationResult.error });
626634

635+
this.sendDebugLog({
636+
runId: run.friendlyId,
637+
message: "failed to continue execution",
638+
properties: {
639+
error: continuationResult.error,
640+
},
641+
});
642+
627643
this.waitForNextRun();
628644
return;
629645
}
@@ -766,6 +782,14 @@ class ManagedRunController {
766782
if (!start.success) {
767783
console.error("[ManagedRunController] Failed to start run", { error: start.error });
768784

785+
this.sendDebugLog({
786+
runId: runFriendlyId,
787+
message: "failed to start run attempt",
788+
properties: {
789+
error: start.error,
790+
},
791+
});
792+
769793
this.waitForNextRun();
770794
return;
771795
}
@@ -850,6 +874,14 @@ class ManagedRunController {
850874
error: completionResult.error,
851875
});
852876

877+
this.sendDebugLog({
878+
runId: run.friendlyId,
879+
message: "completion: failed to submit after error",
880+
properties: {
881+
error: completionResult.error,
882+
},
883+
});
884+
853885
this.waitForNextRun();
854886
return;
855887
}
@@ -1139,6 +1171,14 @@ class ManagedRunController {
11391171
error: completionResult.error,
11401172
});
11411173

1174+
this.sendDebugLog({
1175+
runId: run.friendlyId,
1176+
message: "completion: failed to submit",
1177+
properties: {
1178+
error: completionResult.error,
1179+
},
1180+
});
1181+
11421182
this.waitForNextRun();
11431183
return;
11441184
}

0 commit comments

Comments
 (0)