chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
1 parent
719370c8f7
commit
6081e3e325
1743 files changed
+205459
-131704
No files matched your search
+110
-16
@@ -23,6 +23,39 @@ describe("getSupportedThinkingLevels", () => {
|
||||
expect(getSupportedThinkingLevels(model!)).toContain("max");
|
||||
});
|
||||
|
||||
it("includes Claude Opus 5.5 with its always-on effort levels and official pricing", () => {
|
||||
const model = getModel("anthropic", "claude-opus-5-5");
|
||||
expect(model).toMatchObject({
|
||||
cost: { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 },
|
||||
contextWindow: 1_000_000,
|
||||
maxTokens: 128_000,
|
||||
compat: {
|
||||
forceAdaptiveThinking: true,
|
||||
supportsMidConvoEffort: true,
|
||||
supportsMidConvoSystemMessages: true,
|
||||
supportsMidConvoToolChanges: true,
|
||||
},
|
||||
});
|
||||
expect(getSupportedThinkingLevels(model)).toEqual(["low", "medium", "high", "xhigh", "max"]);
|
||||
});
|
||||
|
||||
it("includes Claude Sonnet 5.5 with managed effort levels and official pricing", () => {
|
||||
const model = getModel("anthropic", "claude-sonnet-5-5");
|
||||
expect(model).toMatchObject({
|
||||
cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 },
|
||||
contextWindow: 1_000_000,
|
||||
maxTokens: 128_000,
|
||||
compat: {
|
||||
forceAdaptiveThinking: true,
|
||||
supportsMidConvoEffort: true,
|
||||
supportsMidConvoSystemMessages: true,
|
||||
supportsMidConvoToolChanges: true,
|
||||
supportsTemperature: false,
|
||||
},
|
||||
});
|
||||
expect(getSupportedThinkingLevels(model)).toEqual(["low", "medium", "high", "xhigh", "max"]);
|
||||
});
|
||||
|
||||
it("includes max but not xhigh for Anthropic Sonnet 4.6 on anthropic-messages API", () => {
|
||||
const model = getModel("anthropic", "claude-sonnet-4-6");
|
||||
expect(model).toBeDefined();
|
||||
@@ -52,16 +85,22 @@ describe("getSupportedThinkingLevels", () => {
|
||||
expect(getSupportedThinkingLevels(model!)).not.toContain("max");
|
||||
});
|
||||
|
||||
it.each(["gpt-5.4", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra"] as const)(
|
||||
"includes xhigh for openai-codex %s models",
|
||||
(modelId) => {
|
||||
const model = getModel("openai-codex", modelId);
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
|
||||
},
|
||||
);
|
||||
it.each([
|
||||
"gpt-5.5",
|
||||
"gpt-5.6-sol",
|
||||
"gpt-5.6-terra",
|
||||
"gpt-5.6-luna",
|
||||
"gpt-6-astra",
|
||||
"gpt-6-sol",
|
||||
"gpt-6-luna",
|
||||
"gpt-6.1-sol",
|
||||
] as const)("includes xhigh for openai-codex %s models", (modelId) => {
|
||||
const model = getModel("openai-codex", modelId);
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
|
||||
});
|
||||
|
||||
it.each(["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"] as const)(
|
||||
it.each(["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-sol", "gpt-6-luna"] as const)(
|
||||
"includes xhigh and max for OpenAI %s models",
|
||||
(modelId) => {
|
||||
const model = getModel("openai", modelId);
|
||||
@@ -70,6 +109,55 @@ describe("getSupportedThinkingLevels", () => {
|
||||
},
|
||||
);
|
||||
|
||||
// OpenAI and Codex reject reasoning.effort "none" for GPT-6.1 Sol.
|
||||
it("does not support off for GPT-6.1 Sol", () => {
|
||||
const expected = {
|
||||
openai: ["low", "medium", "high", "xhigh", "max"],
|
||||
azure: ["low", "medium", "high", "xhigh", "max"],
|
||||
"openai-codex": ["minimal", "low", "medium", "high", "xhigh", "max"],
|
||||
} as const;
|
||||
for (const [provider, levels] of Object.entries(expected)) {
|
||||
const model = getModel(provider as keyof typeof expected, "gpt-6.1-sol");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(levels);
|
||||
expect(model!.thinkingLevelMap?.off).toBeNull();
|
||||
}
|
||||
});
|
||||
|
||||
it.each([
|
||||
["gpt-6-sol", { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, 272000],
|
||||
["gpt-6-luna", { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 }, 272000],
|
||||
// Codex serves GPT-6.1 Sol with a 500K default context window (#10840)
|
||||
["gpt-6.1-sol", { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 }, 500000],
|
||||
] as const)("includes official metadata for OpenAI and Codex %s", (modelId, cost, codexContextWindow) => {
|
||||
for (const provider of ["openai", "openai-codex"] as const) {
|
||||
const model = getModel(provider, modelId);
|
||||
expect(model).toMatchObject({
|
||||
input: ["text", "image"],
|
||||
cost: {
|
||||
...cost,
|
||||
tiers: [
|
||||
{
|
||||
inputTokensAbove: 272000,
|
||||
input: cost.input * 2,
|
||||
output: cost.output * 1.5,
|
||||
cacheRead: cost.cacheRead * 2,
|
||||
cacheWrite: cost.cacheWrite * 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
contextWindow: provider === "openai-codex" ? codexContextWindow : 272000,
|
||||
maxTokens: 128000,
|
||||
compat: {
|
||||
supportsAdditionalTools: true,
|
||||
supportsMidConvoSystemMessages: true,
|
||||
supportsOpenAIGrammarTools: true,
|
||||
supportsToolSearch: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("includes only medium/high/xhigh for OpenAI GPT-5.5 Pro", () => {
|
||||
const model = getModel("openai", "gpt-5.5-pro");
|
||||
expect(model).toBeDefined();
|
||||
@@ -82,22 +170,22 @@ describe("getSupportedThinkingLevels", () => {
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]);
|
||||
});
|
||||
|
||||
it("includes low/high/max plus off for DeepSeek V4 Flash on the DeepSeek provider", () => {
|
||||
const model = getModel("deepseek", "deepseek-v4-flash");
|
||||
it("includes low/high/max plus off for DeepSeek V4.1 Flash on the DeepSeek provider", () => {
|
||||
const model = getModel("deepseek", "deepseek-flash");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("includes low/high/max plus off for DeepSeek V4 Flash on opencode-go", () => {
|
||||
const model = getModel("opencode-go", "deepseek-v4-flash");
|
||||
it("preserves low/high/max metadata for DeepSeek V4.1 Flash on OpenRouter", () => {
|
||||
const model = getModel("openrouter", "deepseek/deepseek-v4.1-flash");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("includes only high plus off for OpenCode Go Kimi K2.6", () => {
|
||||
const model = getModel("opencode-go", "kimi-k2.6");
|
||||
it("preserves low/high/max metadata for DeepSeek V4.1 Flash on opencode-go", () => {
|
||||
const model = getModel("opencode-go", "deepseek-v4.1-flash");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high"]);
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("excludes thinking off for Moonshot Kimi K2.7 Code models", () => {
|
||||
@@ -121,6 +209,12 @@ describe("getSupportedThinkingLevels", () => {
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("excludes off for always-thinking Kimi Coding Highspeed", () => {
|
||||
const model = getModel("kimi-coding", "kimi-for-coding-highspeed");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).not.toContain("off");
|
||||
});
|
||||
|
||||
it("includes only high for OpenCode Grok Build", () => {
|
||||
const model = getModel("opencode", "grok-build-0.1");
|
||||
expect(model).toBeDefined();
|
||||
|
||||
Reference in new issue
Block a user