Skip to content

Commit a83094c

Browse files
committed
test(core): cap Copilot fallback endpoint polling
1 parent 6b54153 commit a83094c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/core/test/plugin/provider-github-copilot.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,12 @@ describe("GithubCopilotPlugin", () => {
441441
})
442442
yield* addPlugin()
443443
// The plugin loads the model list in the background; poll on real time because the
444-
// test clock does not advance on its own.
444+
// test clock does not advance on its own. Cap at ~2s so a regression fails the
445+
// assertions below instead of hanging until the runner timeout.
445446
const fallback = yield* Effect.promise(() => Bun.sleep(10)).pipe(
446447
Effect.andThen(models.get(Provider.ID.githubCopilot, Model.ID.make("claude-sonnet-5"))),
447448
Effect.map(required),
448-
Effect.repeat({ until: (model) => model.settings?.baseURL !== "https://api.githubcopilot.com/v1" }),
449+
Effect.repeat({ until: (model) => model.settings?.baseURL !== "https://api.githubcopilot.com/v1", times: 200 }),
449450
)
450451
expect(fallback.package).toBe("@opencode/ai/providers/anthropic")
451452
expect(fallback.settings?.baseURL).toBe(`${server.url.origin}/v1`)

0 commit comments

Comments
 (0)