fix(ai): enable xhigh for DeepSeek V4 Flash

closes #3944
This commit is contained in:
Mario Zechner
2026-04-29 23:32:02 +02:00
parent 83592bb2df
commit d23cf31634
3 changed files with 22 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
### Fixed
- Fixed DeepSeek V4 Flash `xhigh` thinking support so requests preserve `xhigh` and map it to DeepSeek's `max` reasoning effort ([#3944](https://github.com/badlogic/pi-mono/issues/3944)).
- Fixed Anthropic streams that end before `message_stop` to be treated as errors instead of successful partial responses ([#3936](https://github.com/badlogic/pi-mono/issues/3936)).
- Fixed generated OpenAI-compatible DeepSeek V4 models to carry the provider-specific reasoning effort mapping outside the direct DeepSeek provider ([#3940](https://github.com/badlogic/pi-mono/issues/3940)).
- Fixed DeepSeek V4 Flash and V4 Pro pricing metadata to match current official rates ([#3910](https://github.com/badlogic/pi-mono/issues/3910)).

View File

@@ -50,7 +50,7 @@ export function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage
*
* Supported today:
* - GPT-5.2 / GPT-5.3 / GPT-5.4 / GPT-5.5 model families
* - DeepSeek V4 Pro
* - DeepSeek V4 Pro and Flash
* - Opus 4.6+ models (xhigh maps to adaptive effort "max" on Anthropic-compatible providers)
*/
export function supportsXhigh<TApi extends Api>(model: Model<TApi>): boolean {
@@ -59,7 +59,8 @@ export function supportsXhigh<TApi extends Api>(model: Model<TApi>): boolean {
model.id.includes("gpt-5.3") ||
model.id.includes("gpt-5.4") ||
model.id.includes("gpt-5.5") ||
model.id.includes("deepseek-v4-pro")
model.id.includes("deepseek-v4-pro") ||
model.id.includes("deepseek-v4-flash")
) {
return true;
}

View File

@@ -26,6 +26,24 @@ describe("supportsXhigh", () => {
expect(supportsXhigh(model!)).toBe(true);
});
it("returns true for DeepSeek V4 Flash on the DeepSeek provider", () => {
const model = getModel("deepseek", "deepseek-v4-flash");
expect(model).toBeDefined();
expect(supportsXhigh(model!)).toBe(true);
});
it("returns true for DeepSeek V4 Flash on opencode-go", () => {
const model = getModel("opencode-go", "deepseek-v4-flash");
expect(model).toBeDefined();
expect(supportsXhigh(model!)).toBe(true);
});
it("returns true for DeepSeek V4 Flash on OpenRouter", () => {
const model = getModel("openrouter", "deepseek/deepseek-v4-flash");
expect(model).toBeDefined();
expect(supportsXhigh(model!)).toBe(true);
});
it("returns true for OpenRouter Opus 4.6 (openai-completions API)", () => {
const model = getModel("openrouter", "anthropic/claude-opus-4.6");
expect(model).toBeDefined();