Skip to content

Commit 383f3fa

Browse files
committed
fix(run-engine): auto-arm the completion guard from the flag for every caller
completeWaitpoint now defaults armGuard to the isBlipRetryEnabled flag, so ALL completion callers (dashboard, realtime, streams, webhook — not just the token routes that opt in) get durable guard coverage when the flag is on. Flag off ⇒ no guard, byte-identical.
1 parent 531956f commit 383f3fa

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • internal-packages/run-engine/src/engine

internal-packages/run-engine/src/engine/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ export class RunEngine {
21122112
async completeWaitpoint({
21132113
id,
21142114
output,
2115-
armGuard = false,
2115+
armGuard,
21162116
}: {
21172117
id: string;
21182118
output?: {
@@ -2121,8 +2121,9 @@ export class RunEngine {
21212121
isError: boolean;
21222122
};
21232123
/**
2124-
* Arm the durable write-ahead completion guard (the caller sets this from the
2125-
* runStoreInfraRetryEnabled flag). Off ⇒ no guard job, byte-identical to before.
2124+
* Force the durable write-ahead completion guard on/off. Left undefined, it defaults to the
2125+
* runStoreInfraRetryEnabled flag, so EVERY completion caller (not only the ones that opt in) is
2126+
* covered when the flag is on. Off ⇒ no guard job, byte-identical to before.
21262127
*/
21272128
armGuard?: boolean;
21282129
}): Promise<Waitpoint> {
@@ -2134,7 +2135,8 @@ export class RunEngine {
21342135
if (guard) {
21352136
await guard({ waitpointId: id, routeKind: "RESUME_TOKEN" });
21362137
}
2137-
return this.waitpointSystem.completeWaitpoint({ id, output, armGuard });
2138+
const shouldArm = armGuard ?? (await (this.options.isBlipRetryEnabled?.() ?? false));
2139+
return this.waitpointSystem.completeWaitpoint({ id, output, armGuard: shouldArm });
21382140
}
21392141

21402142
/**

0 commit comments

Comments
 (0)