Files
oh-my-opencode/packages/model-core/src/model-capabilities-bundled-snapshot.test.ts
T
YeonGyu-Kim e15461febc refactor(model-core): inject bundled capabilities snapshot from harness
- remove bundled snapshot dependency on src/generated in model-core

- make shared harness provide runtime bundled snapshot

- update guardrail and capability tests to pass explicit snapshot

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-21 12:50:10 +09:00

36 lines
1.1 KiB
TypeScript

import { describe, expect, test } from "bun:test"
import { getBundledModelCapabilitiesSnapshot, getModelCapabilities } from "./model-capabilities"
import bundledModelCapabilitiesSnapshotJson from "./generated/model-capabilities.generated.json"
describe("bundled model capabilities snapshot", () => {
test("keeps GPT-4.1 OpenAI variants marked as supporting tool calls", () => {
// given
const bundledSnapshot = getBundledModelCapabilitiesSnapshot(bundledModelCapabilitiesSnapshotJson)
const modelIDs = [
"openai/gpt-4.1",
"openai/gpt-4.1-mini",
"openai/gpt-4.1-nano",
]
// when
const results = modelIDs.map((modelID) =>
getModelCapabilities({
providerID: "openai",
modelID,
bundledSnapshot,
}),
)
// then
for (const result of results) {
expect(result.toolCall).toBe(true)
expect(result.diagnostics).toMatchObject({
resolutionMode: "snapshot-backed",
snapshot: { source: "bundled-snapshot" },
toolCall: { source: "bundled-snapshot" },
})
}
})
})