Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): codex usage-limit failures keep their reset time #27787

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

Showing 7 changed files with 142 additions and 0 deletions (loading 6).

x
0 of 7 viewed, 7 left
142 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -6018,6 +6018,148 @@
+ // regression: #27773 a 429 on a run's first request still reports the reset time
+ it.effect(
+ "recovers resetAt from a fresh rate-limits read when the 429 never primed the snapshot",
+ () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const nativeThreadId = "native-limit-cold-429";
+ const nativeTurnId = "turn-limit-cold-429";
+ const message = "Provider stopped this request.";
+ const resetAt = "2033-05-19T07:20:00.000Z";
+ const transcript = makeCodexReplayTranscript({
+ scenario: "codex-limit-cold-429",
+ entries: [
+ ...codexReplayPreamble({ nativeThreadId, nativeTurnId, prompt: "Continue." }),
+ {
+ type: "emit_inbound",
+ label: "error",
+ frame: {
+ method: "error",
+ params: {
+ threadId: nativeThreadId,
+ turnId: nativeTurnId,
+ willRetry: false,
+ error: { message, codexErrorInfo: "usageLimitExceeded" },
+ },
+ },