GeezerVison is showing github.com — fix(server): give Codex's provider probe its own longer timeout · pingdotgg/t3code@ccb5cc4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/server/src/provider/CodexProvider.ts +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,7 +34,6 @@ import { | 34 | 34 | import { resolveSpawnCommand } from "@t3tools/shared/shell"; | 35 | 35 | import { codexAppServerArgs, resolveCodexLaunchArgs } from "./codexLaunchArgs.ts"; | 36 | 36 | import { | 37 | | - AUTH_PROBE_TIMEOUT_MS, | 38 | 37 | buildServerProvider, | 39 | 38 | COMPACT_SLASH_COMMAND, | 40 | 39 | type ServerProviderDraft, | @@ -63,6 +62,11 @@ type CodexRateLimitsProbe = | 63 | 62 | | { readonly failure: string }; | 64 | 63 |
| 65 | 64 | const CODEX_APP_SERVER_PROBE_FORCE_KILL_AFTER = "2 seconds" as const; | | 65 | +// Codex's probe does a full handshake plus account, models, and skills requests, which can | | 66 | +// legitimately run past the shared 10s AUTH_PROBE_TIMEOUT_MS on a loaded or slow machine | | 67 | +// (most often reported on Windows). Give Codex its own longer budget instead of raising the | | 68 | +// timeout for every provider. | | 69 | +const CODEX_AUTH_PROBE_TIMEOUT_MS = 20_000; | 66 | 70 |
| 67 | 71 | const CODEX_PRESENTATION = { | 68 | 72 | displayName: "Codex", | @@ -618,7 +622,7 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu | 618 | 622 | ...(managedAuth ? { skipNativeUsage: true } : {}), | 619 | 623 | }).pipe( | 620 | 624 | Effect.scoped, | 621 | | - Effect.timeoutOption(Duration.millis(AUTH_PROBE_TIMEOUT_MS)), | | 625 | + Effect.timeoutOption(Duration.millis(CODEX_AUTH_PROBE_TIMEOUT_MS)), | 622 | 626 | Effect.result, | 623 | 627 | ); | 624 | 628 |
| |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/provider/ProviderRegistry.test.ts +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -578,6 +578,22 @@ it.layer( | 578 | 578 | }), | 579 | 579 | ); | 580 | 580 |
| | 581 | + it.effect( | | 582 | + "does not time out a healthy probe slower than the shared 10s auth-probe timeout (#7513)", | | 583 | + () => | | 584 | + Effect.gen(function* () { | | 585 | + const statusFiber = yield* checkCodexProviderStatus(defaultCodexSettings, () => | | 586 | + Effect.sleep("15 seconds").pipe(Effect.as(makeCodexProbeSnapshot())), | | 587 | + ).pipe(Effect.forkChild); | | 588 | + | | 589 | + yield* Effect.yieldNow; | | 590 | + yield* TestClock.adjust("15 seconds"); | | 591 | + | | 592 | + const status = yield* Fiber.join(statusFiber); | | 593 | + assert.strictEqual(status.status, "ready"); | | 594 | + }), | | 595 | + ); | | 596 | + | 581 | 597 | it.effect("closes the app-server probe scope when provider status times out", () => | 582 | 598 | Effect.gen(function* () { | 583 | 599 | const killCalls = yield* Ref.make(0); | @@ -587,7 +603,7 @@ it.layer( | 587 | 603 | ); | 588 | 604 |
| 589 | 605 | yield* Effect.yieldNow; | 590 | | - yield* TestClock.adjust("11 seconds"); | | 606 | + yield* TestClock.adjust("21 seconds"); | 591 | 607 | yield* Effect.yieldNow; | 592 | 608 |
| 593 | 609 | const status = yield* Fiber.join(statusFiber); | |
|