fix(providers): allow two minutes for catalog refreshes
Provider catalog discovery can exceed one minute during cold startup. Increase the default deadline while preserving explicit config and environment overrides.
This commit is contained in:
@@ -442,6 +442,40 @@ describe("ProviderSnapshotManager public surface", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("defaults provider refreshes to a two-minute deadline", async () => {
|
||||
vi.useFakeTimers();
|
||||
const manager = new ProviderSnapshotManager({
|
||||
logger: createTestLogger(),
|
||||
providerOverrides: {
|
||||
claude: { enabled: false },
|
||||
copilot: { enabled: false },
|
||||
opencode: { enabled: false },
|
||||
pi: { enabled: false },
|
||||
},
|
||||
extraClients: {
|
||||
codex: createExtraClient("codex", { isAvailable: waitUntilAborted }),
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
const entryPromise = manager.getProvider({
|
||||
cwd: "/tmp/project",
|
||||
provider: "codex",
|
||||
wait: true,
|
||||
});
|
||||
|
||||
await vi.advanceTimersByTimeAsync(120_000);
|
||||
|
||||
await expect(entryPromise).resolves.toMatchObject({
|
||||
status: "error",
|
||||
error: "Timed out refreshing Codex after 120000ms; pending: availability",
|
||||
});
|
||||
} finally {
|
||||
manager.destroy();
|
||||
vi.useRealTimers();
|
||||
}
|
||||
});
|
||||
|
||||
test("one refresh timeout covers availability and catalog discovery", async () => {
|
||||
vi.useFakeTimers();
|
||||
const manager = new ProviderSnapshotManager({
|
||||
|
||||
@@ -45,7 +45,7 @@ import {
|
||||
validateAgentConfigurationAgainstProvider,
|
||||
} from "./agent-configuration-validator.js";
|
||||
|
||||
const DEFAULT_REFRESH_TIMEOUT_MS = 60_000;
|
||||
const DEFAULT_REFRESH_TIMEOUT_MS = 120_000;
|
||||
const MAX_REFRESH_TIMEOUT_MS = 2_147_483_647;
|
||||
const DEFAULT_DIAGNOSTIC_TIMEOUT_MS = 120_000;
|
||||
const REFRESH_TIMEOUT_ENV_VAR = "PASEO_PROVIDER_REFRESH_TIMEOUT_MS";
|
||||
|
||||
Reference in New Issue
Block a user