Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/opencode/test/provider/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ test("Altimate Base is pinned to the hosted model contract without affecting oth
expect(base.options.baseURL).toBe(`${ALTIMATE_BASE_GATEWAY_URL}/v1`)
expect(base.options.apiKey).toBe(FreeTier.MANAGED_API_KEY_PLACEHOLDER)
// BUG FIX: without a client-side header timeout, a hung gateway response never resolves
// or rejects — the CLI just hangs. This mirrors the openai loader's default.
expect(base.options.headerTimeout).toBe(10_000)
// or rejects — the CLI just hangs. The value is NOT the openai loader's 10s: Altimate
// Base can queue for capacity, cold-start, or reason before flushing headers, so #1260
// set FREE_TIER_HEADER_TIMEOUT_DEFAULT to the SSE chunk watchdog's 5 minutes (env
// ALTIMATE_BASE_HEADER_TIMEOUT_MS overrides it; not set in this test).
expect(base.options.headerTimeout).toBe(300_000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Isolate the default-timeout assertion from the environment

When the test runner inherits ALTIMATE_BASE_HEADER_TIMEOUT_MS (for example, a developer or CI job sets it to 600000 or off), freeTierHeaderTimeout() returns that override and this assertion fails even though the provider is behaving correctly. The comment only states that the variable is not set by this test; it does not remove the value captured from process.env. Clear the key from the instance's Env before calling Provider.list() so this test deterministically verifies the default.

Useful? React with 👍 / 👎.

expect(JSON.stringify(base)).not.toContain("sk-altimate-base")

const model = base.models[FreeTier.MODEL_ID]
Expand Down
Loading