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:
@@ -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", () => {
|
||||
|
||||
@@ -3,11 +3,12 @@ import * as fs from "node:fs/promises";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import type { Model } from "@oh-my-pi/pi-ai";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
import { RawSseDebugBuffer } from "@oh-my-pi/pi-coding-agent/debug/raw-sse-buffer";
|
||||
import { createReportBundle } from "@oh-my-pi/pi-coding-agent/debug/report-bundle";
|
||||
import { getConfigRootDir, setAgentDir } from "@oh-my-pi/pi-utils";
|
||||
|
||||
const model: Model<"anthropic-messages"> = {
|
||||
const model: Model<"anthropic-messages"> = buildModel({
|
||||
id: "claude-test",
|
||||
name: "Claude Test",
|
||||
api: "anthropic-messages",
|
||||
@@ -18,7 +19,7 @@ const model: Model<"anthropic-messages"> = {
|
||||
cost: { input: 1, output: 1, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 200_000,
|
||||
maxTokens: 8_192,
|
||||
};
|
||||
});
|
||||
|
||||
const originalAgentDir = process.env.PI_CODING_AGENT_DIR;
|
||||
const originalXdgStateHome = process.env.XDG_STATE_HOME;
|
||||
|
||||
Reference in New Issue
Block a user