Skip to content

Commit 13c25fd

Browse files
fix(server): Codex usage answering after three seconds is no longer dropped
The account/rateLimits/read request had its own 3 s cap on top of the probe's discovery deadline, so a valid answer that took 3-8 s, common for real Codex, was thrown away and Usage showed "Codex did not answer the usage request.". The probe deadline already keeps account and model discovery safe, so bound the usage read by that deadline alone. Fixes #36180 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 9229549 commit 13c25fd

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎apps/server/src/provider/CodexProvider.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import {
5757
import * as HostProcess from "@t3tools/shared/HostProcess";
5858
import packageJson from "../../package.json" with { type: "json" };
5959
const isCodexAppServerSpawnError = Schema.is(CodexErrors.CodexAppServerSpawnError);
60-
const RATE_LIMITS_PROBE_TIMEOUT_MS = 3_000;
6160

6261
type CodexRateLimitsProbe =
6362
| {
@@ -670,11 +669,7 @@ const readCodexRateLimits = (
670669
client: CodexClient.CodexAppServerClient["Service"],
671670
deadlineMs: number,
672671
) =>
673-
withCodexDiscoveryDeadline(
674-
client.request("account/rateLimits/read", null),
675-
deadlineMs,
676-
RATE_LIMITS_PROBE_TIMEOUT_MS,
677-
).pipe(
672+
withCodexDiscoveryDeadline(client.request("account/rateLimits/read", null), deadlineMs).pipe(
678673
Effect.map((response): CodexRateLimitsProbe =>
679674
response
680675
? {

0 commit comments

Comments
 (0)