Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve known Claude usage-limit resets #15694

Closedashx-j(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/15694/headopened View on GitHub

Showing 2 changed files with 151 additions and 4 deletions.

x
0 of 2 viewed, 2 left
135 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -3,6 +3,7 @@
import type {
Query as ClaudeQuery,
SDKMessage,
+ SDKRateLimitInfo,
SDKResultMessage,
SDKUserMessage,
} from "@anthropic-ai/claude-agent-sdk";
@@ -43,6 +44,7 @@
import * as Schema from "effect/Schema";
import * as Scope from "effect/Scope";
import * as Stream from "effect/Stream";
+import * as TestClock from "effect/testing/TestClock";
import { Tool } from "effect/unstable/ai";
import { formatClaudeResumeCompactionQuestion } from "@t3tools/shared/claudeCompaction";
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
@@ -2584,6 +2586,139 @@
}).pipe(Effect.provide(Layer.merge(IdAllocator.layer, NodeServices.layer))),
+ const limitResetAt = "2026-10-04T14:00:00.000Z";
+ const limitResetsAt = DateTime.toEpochMillis(DateTime.makeUnsafe(limitResetAt)) / 1000;
+ it.effect.each([
+ {
+ name: "a repeated window omits its reset",
+ updates: [
+ { status: "rejected", rateLimitType: "five_hour", resetsAt: limitResetsAt },
+ { status: "rejected", rateLimitType: "five_hour" },