feat: added build-time compatibility in ModelSpec/buildModel pipeline

- Centralized catalog and registry handling on `ModelSpec` and `buildModel`, resolving compatibility at model build time.
- Removed runtime compatibility detectors and switched provider request flows to direct `model.compat` reads.
- Added compat fields (`supportsReasoningParams`, `alwaysSendMaxTokens`, `strictResponsesPairing`, `whenThinking`).
- Persisted explicit compatibility overrides through `compatConfig` in discovery and cache merge paths.
This commit is contained in:
can1357
2026-06-10 06:20:51 +02:00
parent fe61625ca8
commit ae415199dc
133 changed files with 1808 additions and 1367 deletions
@@ -1,12 +1,13 @@
import { describe, expect, it } from "bun:test";
import type { Model } from "@oh-my-pi/pi-ai";
import { buildModel } from "@oh-my-pi/pi-catalog/build";
import {
RawSseDebugBuffer,
rawSseRecordLines,
resolveRawSseDebugBuffer,
} from "@oh-my-pi/pi-coding-agent/debug/raw-sse-buffer";
const model: Model<"anthropic-messages"> = {
const model: Model<"anthropic-messages"> = buildModel({
id: "claude-test",
name: "Claude Test",
api: "anthropic-messages",
@@ -17,7 +18,7 @@ const model: Model<"anthropic-messages"> = {
cost: { input: 1, output: 1, cacheRead: 0, cacheWrite: 0 },
contextWindow: 200_000,
maxTokens: 8_192,
};
});
describe("RawSseDebugBuffer", () => {
it("records response metadata and raw SSE frame lines for diagnostics", () => {