Skip to content

Commit 3af86a4

Browse files
Silthusclaude
andcommitted
test(server): limit recovery refuses a thread with a remote request
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 0cac39f commit 3af86a4

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6503,6 +6503,7 @@ it.layer(layerTest)("usage-limit recovery", (it) => {
65036503
"replacement",
65046504
"manual-snooze",
65056505
"invalid-snooze",
6506+
"remote-request",
65066507
"cancel-resume-keep-snooze",
65076508
"independent-patches",
65086509
"expired-snooze",
@@ -6641,11 +6642,35 @@ it.layer(layerTest)("usage-limit recovery", (it) => {
66416642
(thread) => thread.id === threadId,
66426643
)!;
66436644
assert.isNull(limitRecoveryCommand(shell, false, DateTime.toEpochMillis(now)));
6644-
if (scenario === "invalid-snooze") {
6645+
if (scenario === "remote-request") {
6646+
const current = yield* orchestrator.getThreadProjection(threadId);
6647+
yield* events.write({
6648+
events: [
6649+
{
6650+
id: EventId.make("recovery:remote-request"),
6651+
type: "thread.metadata-updated",
6652+
threadId,
6653+
occurredAt: now,
6654+
payload: {
6655+
...current.thread,
6656+
remoteTaskRequests: [
6657+
{
6658+
requestId: RuntimeRequestId.make("recovery:remote-request:approval"),
6659+
kind: "command",
6660+
createdAt: now,
6661+
taskId: NodeId.make("recovery:remote-request:task"),
6662+
},
6663+
],
6664+
},
6665+
},
6666+
],
6667+
});
6668+
}
6669+
if (scenario === "invalid-snooze" || scenario === "remote-request") {
66456670
const result = yield* orchestrator
66466671
.dispatch({
66476672
type: "thread.metadata.update",
6648-
commandId: CommandId.make("recovery:invalid-snooze"),
6673+
commandId: CommandId.make(`recovery:refused:${scenario}`),
66496674
threadId,
66506675
limitRecovery: { runId: run.id, resetAt, snooze: true },
66516676
})

0 commit comments

Comments
 (0)