Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): ignore stale Claude wake limits after recovery #46090

Openzicozz876(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/46090/headopened View on GitHub

Showing 2 changed files with 235 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
235 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -20093,6 +20093,241 @@
+ it.effect.each([
+ { scenario: "a successful user turn", expectedStatus: "completed" },
+ { scenario: "a local rename", expectedStatus: "failed" },
+ { scenario: "a successful reply held for a discarded steer", expectedStatus: "completed" },
+ { scenario: "a successful user turn followed by an API failure", expectedStatus: "completed" },
+ { scenario: "an API failure on a replacement query", expectedStatus: "completed" },
+ { scenario: "a newer wake starting with an assistant frame", expectedStatus: "completed" },
+ { scenario: "a newer wake starting with an init frame", expectedStatus: "completed" },
+ ] as const)(
+ "replays a buffered wake limit after $scenario as $expectedStatus",
+ ({ scenario, expectedStatus }) =>
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarnessWithOptions({ freshQueueOnReopen: true });
+ const startTurn = (ordinal: number, text: string, continuation = false) =>
+ Effect.gen(function* () {
+ const input = makeClaudeTestTurnInput({
+ threadId: harness.threadId,
+ providerThread: harness.providerThread,
+ now: yield* DateTime.now,
+ attemptId: RunAttemptId.make(`attempt-claude-stale-wake-${ordinal}`),
+ providerTurnOrdinal: ordinal,
+ text,
+ attachments: [],
+ ...(scenario === "an API failure on a replacement query" && ordinal === 3
+ ? { runtimePolicy: { ...CLAUDE_TEST_RUNTIME_POLICY, runtimeMode: "auto" } }
+ : {}),