review: pin off-value wire contract, scope compat inheritance to the entry's api, update the superseded note
Review findings on #1977, each verified before acting: the 2026-08-03 declared-provider-catalog note is updated in place and cross-linked both ways now that reasoningEfforts/compat reopened half of its rejected alternative; resolveModelCompat inherits the catalog entry's compat only while the resolved api still is the entry's own, so a route-level api repoint no longer merges another protocol's shape as a completions base; the off-with-value promise gains a request-boundary test proving pi-ai reads thinkingLevelMap.off when the reasoning option is absent (and the catalog-level test name stops overclaiming); the cannot-stop-thinking wording narrows to what is actually enforced (no Off offered, explicit Off refused — an effortless request goes out bare); the z.const(null) comment attributes null passthrough to schemastery's nullable short-circuit; the baseten drift-gate claim names its verification source; and the layered-merge delete gap for dict keys is documented under Known Limitations with the atomic-leaf follow-up in #2003.
This commit is contained in:
@@ -347,9 +347,13 @@ function resolveModelCompat(
|
||||
}
|
||||
return {}
|
||||
}
|
||||
// The installed entry's compat matches its own api, so on an
|
||||
// openai-completions model it is the completions shape.
|
||||
const inherited: OpenAICompletionsCompat | undefined = base?.compat
|
||||
// The installed entry's compat matches the entry's OWN api — a route-level
|
||||
// `api` repoint (an anthropic catalog served through an OpenAI-compatible
|
||||
// gateway) leaves `base.compat` in the other protocol's shape, so it is
|
||||
// inherited only while the resolved api still is the entry's. A repointed
|
||||
// model starts from pi-ai's baseURL-derived detection instead, which is
|
||||
// what a protocol change means for every other compat field too.
|
||||
const inherited: OpenAICompletionsCompat | undefined = base?.api === api ? base.compat : undefined
|
||||
return {
|
||||
compat: {
|
||||
...inherited,
|
||||
|
||||
@@ -161,12 +161,14 @@ const compatProfile: z<PiAiCompatProfile> = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Keys are the offered levels, values their wire spellings. `z.const(null)`
|
||||
* keeps a valueless key (`off:`) alive through validation — only resolution
|
||||
* decides which levels may leave the value empty, so the diagnostic can name
|
||||
* the route and model. The assertion narrows schemastery's `Dict`, which
|
||||
* types every literal key as required; dict validation is per-present-key, so
|
||||
* the runtime shape is the partial record.
|
||||
* Keys are the offered levels, values their wire spellings. A valueless key
|
||||
* (`off:`) survives validation because schemastery passes nullable data
|
||||
* through before any member schema runs — `z.const(null)` only shapes the
|
||||
* error for non-null wrong values and what a configuration surface renders.
|
||||
* Only resolution decides which levels may leave the value empty, so the
|
||||
* diagnostic can name the route and model. The assertion narrows
|
||||
* schemastery's `Dict`, which types every literal key as required; dict
|
||||
* validation is per-present-key, so the runtime shape is the partial record.
|
||||
*/
|
||||
const reasoningEfforts = z.dict(
|
||||
z.union([z.string(), z.const(null)]),
|
||||
|
||||
Reference in New Issue
Block a user