Skip to content

Commit 5bb50dc

Browse files
authored
fix(server): restart continuation checks before repeating side effects (#27836)
1 parent 1917c8a commit 5bb50dc

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/RestartContinuation.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,9 @@ it.effect("continues a cut run past queued follow-ups, which stay held", () =>
915915
...cut,
916916
runs: [...cut.runs, queuedFollowUp],
917917
} as unknown as OrchestrationV2ThreadProjection);
918-
assert.deepEqual(texts, ["Continue where you left off."]);
918+
assert.deepEqual(texts, [
919+
"Continue where you left off. Your last turn was cut short, so a command or other action it started may have finished or may still be running. Before you repeat one that changes state, confirm it did not take effect and is not still running; if you cannot tell, say so instead of repeating it.",
920+
]);
919921
}),
920922
);
921923

@@ -945,7 +947,9 @@ it.effect("continues a resumed queued run that ran after an earlier continuation
945947
...cut,
946948
runs: [...cut.runs, finishedContinuation],
947949
} as unknown as OrchestrationV2ThreadProjection);
948-
assert.deepEqual(texts, ["Continue where you left off."]);
950+
assert.deepEqual(texts, [
951+
"Continue where you left off. Your last turn was cut short, so a command or other action it started may have finished or may still be running. Before you repeat one that changes state, confirm it did not take effect and is not still running; if you cannot tell, say so instead of repeating it.",
952+
]);
949953
}),
950954
);
951955

‎apps/server/src/orchestration-v2/RestartContinuation.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import {
3030
restartContinuationNote,
3131
} from "./RestartBackgroundNote.ts";
3232

33-
const CONTINUE_PROMPT = "Continue where you left off.";
33+
const CONTINUE_PROMPT =
34+
"Continue where you left off. Your last turn was cut short, so a command or other action it started may have finished or may still be running. Before you repeat one that changes state, confirm it did not take effect and is not still running; if you cannot tell, say so instead of repeating it.";
3435

3536
const MAX_CONTINUATION_CHAIN = 3;
3637
const CONTINUATION_LOOP_WINDOW_MS = 5 * 60 * 1_000;

0 commit comments

Comments
 (0)