Agent: guard reminder promises behind cron scheduling

This commit is contained in:
Vignesh Natarajan
2026-02-16 13:34:09 -08:00
committed by Vignesh
parent 0cff8bc4e6
commit 5a26d1c622
10 changed files with 222 additions and 7 deletions

View File

@@ -948,6 +948,7 @@ export async function runEmbeddedPiAgent(
didSendViaMessagingTool: attempt.didSendViaMessagingTool,
messagingToolSentTexts: attempt.messagingToolSentTexts,
messagingToolSentTargets: attempt.messagingToolSentTargets,
successfulCronAdds: attempt.successfulCronAdds,
};
}
@@ -989,6 +990,7 @@ export async function runEmbeddedPiAgent(
didSendViaMessagingTool: attempt.didSendViaMessagingTool,
messagingToolSentTexts: attempt.messagingToolSentTexts,
messagingToolSentTargets: attempt.messagingToolSentTargets,
successfulCronAdds: attempt.successfulCronAdds,
};
}
} finally {

View File

@@ -759,6 +759,7 @@ export async function runEmbeddedAttempt(
waitForCompactionRetry,
getMessagingToolSentTexts,
getMessagingToolSentTargets,
getSuccessfulCronAdds,
didSendViaMessagingTool,
getLastToolError,
getUsageTotals,
@@ -1172,6 +1173,7 @@ export async function runEmbeddedAttempt(
didSendViaMessagingTool: didSendViaMessagingTool(),
messagingToolSentTexts: getMessagingToolSentTexts(),
messagingToolSentTargets: getMessagingToolSentTargets(),
successfulCronAdds: getSuccessfulCronAdds(),
cloudCodeAssistFormatError: Boolean(
lastAssistant?.errorMessage && isCloudCodeAssistFormatError(lastAssistant.errorMessage),
),

View File

@@ -43,6 +43,7 @@ export type EmbeddedRunAttemptResult = {
didSendViaMessagingTool: boolean;
messagingToolSentTexts: string[];
messagingToolSentTargets: MessagingToolSend[];
successfulCronAdds?: number;
cloudCodeAssistFormatError: boolean;
attemptUsage?: NormalizedUsage;
compactionCount?: number;

View File

@@ -65,6 +65,8 @@ export type EmbeddedPiRunResult = {
messagingToolSentTexts?: string[];
// Messaging tool targets that successfully sent a message during the run.
messagingToolSentTargets?: MessagingToolSend[];
// Count of successful cron.add tool calls in this run.
successfulCronAdds?: number;
};
export type EmbeddedPiCompactResult = {