mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
Some checks are pending
check / typecheck (push) Waiting to run
deploy-files / deploy (push) Waiting to run
deploy-www / deploy (push) Waiting to run
nix-eval / nix-eval (push) Waiting to run
publish / version (push) Waiting to run
publish / build-cli (push) Blocked by required conditions
publish / sign-cli-macos (push) Blocked by required conditions
publish / build-node-app-archive (push) Blocked by required conditions
publish / build-node-cli (map[bun_install_flags:--cpu=* host:blacksmith-4vcpu-windows-2025 target:windows-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404 target:linux-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404-arm target:linux-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-windows-2025 target:windows-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:macos-26 target:darwin-arm64]) (push) Blocked by required conditions
publish / sign-cli-windows (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Blocked by required conditions
publish / build-electron (map[host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Blocked by required conditions
publish / publish (push) Blocked by required conditions
publish / notify-discord-v2 (push) Blocked by required conditions
test / affected packages (push) Waiting to run
test / unit (linux) (push) Waiting to run
test / unit (windows) (push) Waiting to run
test / e2e (linux) (push) Blocked by required conditions
test / e2e (windows) (push) Blocked by required conditions
64 lines
2 KiB
TypeScript
64 lines
2 KiB
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { Effect } from "effect"
|
|
import { Provider } from "@opencode/core/provider"
|
|
|
|
describe("Provider", () => {
|
|
test("loads bundled native provider entrypoints", async () => {
|
|
const packages = [
|
|
"@opencode/ai/providers/baseten",
|
|
"@opencode/ai/providers/cerebras",
|
|
"@opencode/ai/providers/cloudflare-ai-gateway",
|
|
"@opencode/ai/providers/cloudflare-workers-ai",
|
|
"@opencode/ai/providers/cohere",
|
|
"@opencode/ai/providers/cohere/chat",
|
|
"@opencode/ai/providers/deepinfra",
|
|
"@opencode/ai/providers/deepseek",
|
|
"@opencode/ai/providers/fireworks",
|
|
"@opencode/ai/providers/google-vertex",
|
|
"@opencode/ai/providers/google-vertex/gemini",
|
|
"@opencode/ai/providers/google-vertex/interactions",
|
|
"@opencode/ai/providers/google-vertex/chat",
|
|
"@opencode/ai/providers/google-vertex/responses",
|
|
"@opencode/ai/providers/google-vertex/messages",
|
|
"@opencode/ai/providers/groq",
|
|
"@opencode/ai/providers/mistral",
|
|
"@opencode/ai/providers/togetherai",
|
|
"@opencode/ai/providers/vercel-ai-gateway",
|
|
]
|
|
|
|
for (const specifier of packages) {
|
|
const loaded = await Effect.runPromise(Provider.loadPackage(specifier))
|
|
expect(loaded.model).toBeFunction()
|
|
}
|
|
})
|
|
|
|
test("passes flat settings to native packages without Core settings", () => {
|
|
expect(
|
|
Provider.nativeSettings({
|
|
apiKey: "secret",
|
|
reasoningEffort: "high",
|
|
chunkTimeout: 1000,
|
|
compaction: { type: "native" },
|
|
transport: "websocket",
|
|
}),
|
|
).toEqual({
|
|
apiKey: "secret",
|
|
reasoningEffort: "high",
|
|
})
|
|
})
|
|
|
|
test("inherits shared and loose settings without provider-only policies", () => {
|
|
expect(
|
|
Provider.modelSettings({
|
|
timeout: 60_000,
|
|
chunkTimeout: 30_000,
|
|
transport: "websocket",
|
|
compaction: { type: "native" },
|
|
reasoningEffort: "high",
|
|
}),
|
|
).toEqual({
|
|
compaction: { type: "native" },
|
|
reasoningEffort: "high",
|
|
})
|
|
})
|
|
})
|