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>
This commit is contained in:
YeonGyu-Kim
2026-05-21 11:36:26 +09:00
parent 2462d7af29
commit e15461febc
8 changed files with 63 additions and 39 deletions
+13 -3
View File
@@ -1,15 +1,25 @@
import {
getBundledModelCapabilitiesSnapshot,
getModelCapabilities as getModelCapabilitiesFromCore,
getBundledModelCapabilitiesSnapshot,
getModelCapabilities as getModelCapabilitiesFromCore,
} from "@oh-my-opencode/model-core"
import type { GetModelCapabilitiesInput, ModelCapabilities } from "@oh-my-opencode/model-core"
import * as connectedProvidersCache from "../connected-providers-cache"
import bundledModelCapabilitiesSnapshotJson from "../../generated/model-capabilities.generated.json"
export { getBundledModelCapabilitiesSnapshot }
export function getBundledModelCapabilitiesSnapshotForRuntime() {
return getBundledModelCapabilitiesSnapshot(bundledModelCapabilitiesSnapshotJson)
}
export function getBundledModelCapabilitiesSnapshotForShared(): ReturnType<typeof getBundledModelCapabilitiesSnapshotForRuntime> {
return getBundledModelCapabilitiesSnapshotForRuntime()
}
export { getBundledModelCapabilitiesSnapshotForShared as getBundledModelCapabilitiesSnapshot }
export function getModelCapabilities(input: GetModelCapabilitiesInput): ModelCapabilities {
return getModelCapabilitiesFromCore({
...input,
bundledSnapshot: input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshotForRuntime(),
providerCache: input.providerCache ?? connectedProvidersCache,
})
}