@oh-my-pi/pi-catalog 17.2.9 → 17.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/types/compat/bedrock.d.ts +1 -1
- package/dist/types/identity/family.d.ts +7 -0
- package/dist/types/provider-models/openai-compat.d.ts +11 -0
- package/dist/types/types.d.ts +13 -0
- package/package.json +4 -5
- package/src/compat/bedrock.ts +28 -1
- package/src/discovery/gitlab-duo-workflow.ts +32 -28
- package/src/identity/family.ts +10 -0
- package/src/model-thinking.ts +10 -9
- package/src/provider-models/openai-compat.ts +71 -4
- package/src/types.ts +13 -0
- package/src/variant-collapse.ts +105 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [17.2.11] - 2026-08-07
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Increased the default stream idle-timeout floor on Amazon Bedrock to 900 seconds for reasoning and adaptive-thinking models (such as Claude) to prevent premature watchdog timeouts during long reasoning stretches.
|
|
10
|
+
- Fixed Devin model families (including SWE-1.7, Claude 5, Gemini 3.6 Flash, Kimi K3, Grok 4.5, and Inkling) to correctly group as logical models with reasoning-effort routing instead of separate wire variants.
|
|
11
|
+
- Added missing context-window and output-token limits for dynamically discovered Alibaba Token Plan models.
|
|
12
|
+
|
|
13
|
+
## [17.2.10] - 2026-08-06
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Removed the zod dependency by migrating GitLab Duo Workflow discovery schemas to omptype.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Corrected thinking-effort tiers for deepseek-v4-flash to include the low tier alongside high and max.
|
|
22
|
+
|
|
5
23
|
## [17.2.9] - 2026-08-05
|
|
6
24
|
|
|
7
25
|
### Fixed
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ModelSpec, ResolvedBedrockCompat } from "../types.js";
|
|
2
|
-
/** Resolve Bedrock Converse prompt-cache
|
|
2
|
+
/** Resolve Bedrock Converse prompt-cache and stream-watchdog compat once per model. */
|
|
3
3
|
export declare function buildBedrockCompat(spec: ModelSpec<"bedrock-converse-stream">): ResolvedBedrockCompat;
|
|
@@ -34,6 +34,13 @@ export declare const isQwenModelId: (modelId: string) => boolean;
|
|
|
34
34
|
export declare const isGemmaModelId: (modelId: string) => boolean;
|
|
35
35
|
/** DeepSeek family by id or display name (proxies often rename the id but keep the name). */
|
|
36
36
|
export declare const isDeepseekModelIdOrName: (modelId: string) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* DeepSeek V4 Flash SKU in any host/namespace form (`deepseek-v4-flash`, dated
|
|
39
|
+
* `deepseek-v4-flash-0731`, `deepseek-ai/DeepSeek-V4-Flash`). Flash is the only
|
|
40
|
+
* V4 model whose `reasoning_effort` accepts the `low` tier; V4 Pro tops out at
|
|
41
|
+
* `high`/`max`. See https://api-docs.deepseek.com/api/create-chat-completion.
|
|
42
|
+
*/
|
|
43
|
+
export declare const isDeepseekV4FlashModelId: (modelId: string) => boolean;
|
|
37
44
|
/** Xiaomi MiMo family by id or display name. */
|
|
38
45
|
export declare const isMimoModelIdOrName: (modelId: string) => boolean;
|
|
39
46
|
/**
|
|
@@ -342,6 +342,17 @@ export interface AlibabaCodingPlanModelManagerConfig {
|
|
|
342
342
|
export declare function alibabaCodingPlanModelManagerOptions(config?: AlibabaCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
343
343
|
export { ALIBABA_TOKEN_PLAN_BASE_URL };
|
|
344
344
|
export declare const ALIBABA_TOKEN_PLAN_STATIC_MODELS: readonly ModelSpec<"openai-completions">[];
|
|
345
|
+
/**
|
|
346
|
+
* Metadata for Alibaba Token Plan models that are dynamically discovered but not
|
|
347
|
+
* in the static catalog. Context window and max tokens are sourced from
|
|
348
|
+
* official model documentation and provider catalogs. Unknown future models
|
|
349
|
+
* remain available with null limits instead of assigning unsafe guessed limits.
|
|
350
|
+
*/
|
|
351
|
+
export interface AlibabaTokenPlanModelLimits {
|
|
352
|
+
contextWindow: number;
|
|
353
|
+
maxTokens: number;
|
|
354
|
+
}
|
|
355
|
+
export declare const ALIBABA_TOKEN_PLAN_DISCOVERED_MODEL_LIMITS: Readonly<Record<string, AlibabaTokenPlanModelLimits>>;
|
|
345
356
|
export interface AlibabaTokenPlanModelManagerConfig {
|
|
346
357
|
apiKey?: string;
|
|
347
358
|
baseUrl?: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -478,6 +478,12 @@ export interface BedrockCompat {
|
|
|
478
478
|
* Capability metadata only; zero means no explicit checkpoints.
|
|
479
479
|
*/
|
|
480
480
|
promptCacheMaximumCheckpoints?: number;
|
|
481
|
+
/**
|
|
482
|
+
* Stream-watchdog idle-timeout fallback in ms; 0 disables the idle watchdog.
|
|
483
|
+
* Undefined defers to `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
|
|
484
|
+
* `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then the 300s default.
|
|
485
|
+
*/
|
|
486
|
+
streamIdleTimeoutMs?: number;
|
|
481
487
|
}
|
|
482
488
|
/** Fully-resolved Bedrock Converse prompt-cache capabilities, materialized once by `buildModel`. */
|
|
483
489
|
export interface ResolvedBedrockCompat {
|
|
@@ -485,6 +491,13 @@ export interface ResolvedBedrockCompat {
|
|
|
485
491
|
supportsLongPromptCacheRetention: boolean;
|
|
486
492
|
promptCacheMinimumTokens: number;
|
|
487
493
|
promptCacheMaximumCheckpoints: number;
|
|
494
|
+
/**
|
|
495
|
+
* Stream-watchdog idle-timeout fallback in ms for hosts with no keepalive
|
|
496
|
+
* events; 0 disables the idle watchdog. Undefined defers to
|
|
497
|
+
* `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
|
|
498
|
+
* `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then the 300s default.
|
|
499
|
+
*/
|
|
500
|
+
streamIdleTimeoutMs?: number;
|
|
488
501
|
}
|
|
489
502
|
/**
|
|
490
503
|
* OpenRouter provider routing preferences.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-catalog",
|
|
4
|
-
"version": "17.2.
|
|
4
|
+
"version": "17.2.11",
|
|
5
5
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -35,12 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@bufbuild/protobuf": "^2.12.1",
|
|
38
|
-
"@oh-my-pi/omptype": "17.2.
|
|
39
|
-
"@oh-my-pi/pi-utils": "17.2.
|
|
40
|
-
"zod": "^4"
|
|
38
|
+
"@oh-my-pi/omptype": "17.2.11",
|
|
39
|
+
"@oh-my-pi/pi-utils": "17.2.11"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@oh-my-pi/pi-ai": "17.2.
|
|
42
|
+
"@oh-my-pi/pi-ai": "17.2.11",
|
|
44
43
|
"@types/bun": "^1.3.14"
|
|
45
44
|
},
|
|
46
45
|
"engines": {
|
package/src/compat/bedrock.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsAdaptiveThinkingDisplay } from "../identity/family";
|
|
1
2
|
import type { ModelSpec, ResolvedBedrockCompat } from "../types";
|
|
2
3
|
import { applyCompatOverrides } from "./apply";
|
|
3
4
|
|
|
@@ -118,9 +119,35 @@ function detectedBedrockCompat(modelId: string): ResolvedBedrockCompat {
|
|
|
118
119
|
return NO_EXPLICIT_CHECKPOINTS;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Bedrock ConverseStream sends no ping/keepalive events, so a reasoning model
|
|
124
|
+
* that goes quiet mid-thinking (summarized-display gaps, `omitted` thinking,
|
|
125
|
+
* or the wedged long tool-call generation of issue #4900) reads as a dead
|
|
126
|
+
* stream to the generic 300s idle watchdog and dies with "Provider stream
|
|
127
|
+
* stalled while waiting for the next event" (issue #4758's Bedrock variant).
|
|
128
|
+
* Widen the floor to 600s for reasoning models, mirroring the GLM coding-plan
|
|
129
|
+
* floor; explicit `spec.compat.streamIdleTimeoutMs` overrides still win.
|
|
130
|
+
*/
|
|
131
|
+
const BEDROCK_REASONING_STREAM_IDLE_TIMEOUT_MS = 600_000;
|
|
132
|
+
/**
|
|
133
|
+
* Adaptive-thinking Claude (Opus 4.7+, Sonnet/Opus 5, Fable/Mythos 5) reasons
|
|
134
|
+
* for much longer stretches, and starting with Opus 4.7 / Fable 5 the
|
|
135
|
+
* Anthropic-side display default is `omitted` (issue #1373), so quiet gaps run
|
|
136
|
+
* longest on exactly this family — Fable 5 being the worst offender in the
|
|
137
|
+
* field. Direct Anthropic keeps these streams alive with ping keepalives and
|
|
138
|
+
* tolerates up to 3x the 300s idle budget of real-event silence (#4900);
|
|
139
|
+
* pingless Bedrock needs the same 900s tolerance in the raw idle floor.
|
|
140
|
+
*/
|
|
141
|
+
const BEDROCK_ADAPTIVE_THINKING_STREAM_IDLE_TIMEOUT_MS = 900_000;
|
|
142
|
+
|
|
143
|
+
/** Resolve Bedrock Converse prompt-cache and stream-watchdog compat once per model. */
|
|
122
144
|
export function buildBedrockCompat(spec: ModelSpec<"bedrock-converse-stream">): ResolvedBedrockCompat {
|
|
123
145
|
const compat = { ...detectedBedrockCompat(spec.id) };
|
|
146
|
+
compat.streamIdleTimeoutMs = spec.reasoning
|
|
147
|
+
? supportsAdaptiveThinkingDisplay(spec.id)
|
|
148
|
+
? BEDROCK_ADAPTIVE_THINKING_STREAM_IDLE_TIMEOUT_MS
|
|
149
|
+
: BEDROCK_REASONING_STREAM_IDLE_TIMEOUT_MS
|
|
150
|
+
: undefined;
|
|
124
151
|
applyCompatOverrides(compat, spec.compat);
|
|
125
152
|
return compat;
|
|
126
153
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { type } from "@oh-my-pi/omptype";
|
|
4
4
|
import type { FetchImpl, ModelSpec } from "../types";
|
|
5
5
|
import { discoveryFetch, isRecord } from "../utils";
|
|
6
6
|
|
|
@@ -54,20 +54,28 @@ const ProjectRootNamespaceQuery = `query omp_gitlabDuoWorkflowProjectRootNamespa
|
|
|
54
54
|
}
|
|
55
55
|
}`;
|
|
56
56
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
const resilientString = type("unknown").pipe(value => {
|
|
58
|
+
if (value === undefined) return undefined;
|
|
59
|
+
const parsed = type("string")(value);
|
|
60
|
+
return parsed instanceof type.errors ? undefined : parsed;
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const resilientUnknownArray = type("unknown").pipe(value => {
|
|
64
|
+
if (value === undefined || value === null) return value;
|
|
65
|
+
const parsed = type("unknown[]")(value);
|
|
66
|
+
return parsed instanceof type.errors ? [] : parsed;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const modelRefSchema = type({
|
|
70
|
+
"name?": resilientString,
|
|
71
|
+
"ref?": resilientString,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const aiChatAvailableModelsSchema = type({
|
|
75
|
+
"defaultModel?": "unknown",
|
|
76
|
+
"selectableModels?": resilientUnknownArray,
|
|
77
|
+
"pinnedModel?": "unknown",
|
|
78
|
+
});
|
|
71
79
|
|
|
72
80
|
type GitLabDuoWorkflowCandidateSource = "override" | "project" | "remote" | "group";
|
|
73
81
|
|
|
@@ -540,17 +548,15 @@ async function postGraphQL(
|
|
|
540
548
|
}
|
|
541
549
|
|
|
542
550
|
function parseAvailability(value: unknown): GitLabDuoWorkflowAvailability | null {
|
|
543
|
-
const parsed = aiChatAvailableModelsSchema
|
|
544
|
-
if (
|
|
545
|
-
return null;
|
|
546
|
-
}
|
|
551
|
+
const parsed = aiChatAvailableModelsSchema(value);
|
|
552
|
+
if (parsed instanceof type.errors) return null;
|
|
547
553
|
return {
|
|
548
|
-
defaultModel: parseModelRef(parsed.
|
|
549
|
-
selectableModels: (parsed.
|
|
554
|
+
defaultModel: parseModelRef(parsed.defaultModel),
|
|
555
|
+
selectableModels: (parsed.selectableModels ?? []).flatMap(model => {
|
|
550
556
|
const parsedModel = parseModelRef(model);
|
|
551
557
|
return parsedModel ? [parsedModel] : [];
|
|
552
558
|
}),
|
|
553
|
-
pinnedModel: parseModelRef(parsed.
|
|
559
|
+
pinnedModel: parseModelRef(parsed.pinnedModel),
|
|
554
560
|
};
|
|
555
561
|
}
|
|
556
562
|
|
|
@@ -558,15 +564,13 @@ function parseModelRef(value: unknown): GitLabDuoWorkflowModelRef | null {
|
|
|
558
564
|
if (value === null || value === undefined) {
|
|
559
565
|
return null;
|
|
560
566
|
}
|
|
561
|
-
const parsed = modelRefSchema
|
|
562
|
-
if (
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
const ref = normalizeIdentifier(parsed.data.ref);
|
|
567
|
+
const parsed = modelRefSchema(value);
|
|
568
|
+
if (parsed instanceof type.errors) return null;
|
|
569
|
+
const ref = normalizeIdentifier(parsed.ref);
|
|
566
570
|
if (!ref) {
|
|
567
571
|
return null;
|
|
568
572
|
}
|
|
569
|
-
const name = normalizeIdentifier(parsed.
|
|
573
|
+
const name = normalizeIdentifier(parsed.name) ?? ref;
|
|
570
574
|
return { name, ref };
|
|
571
575
|
}
|
|
572
576
|
|
package/src/identity/family.ts
CHANGED
|
@@ -83,6 +83,16 @@ export const isDeepseekModelIdOrName = memo((value: string): boolean => {
|
|
|
83
83
|
return value.toLowerCase().includes("deepseek");
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* DeepSeek V4 Flash SKU in any host/namespace form (`deepseek-v4-flash`, dated
|
|
88
|
+
* `deepseek-v4-flash-0731`, `deepseek-ai/DeepSeek-V4-Flash`). Flash is the only
|
|
89
|
+
* V4 model whose `reasoning_effort` accepts the `low` tier; V4 Pro tops out at
|
|
90
|
+
* `high`/`max`. See https://api-docs.deepseek.com/api/create-chat-completion.
|
|
91
|
+
*/
|
|
92
|
+
export const isDeepseekV4FlashModelId = memo((modelId: string): boolean => {
|
|
93
|
+
return bareModelId(modelId).toLowerCase().includes("deepseek-v4-flash");
|
|
94
|
+
});
|
|
95
|
+
|
|
86
96
|
/** Xiaomi MiMo family by id or display name. */
|
|
87
97
|
export const isMimoModelIdOrName = memo((value: string): boolean => {
|
|
88
98
|
return value.toLowerCase().includes("mimo");
|
package/src/model-thinking.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
findThinkingVariantToken,
|
|
26
26
|
isDeepseekModelIdOrName,
|
|
27
|
+
isDeepseekV4FlashModelId,
|
|
27
28
|
isGlm52ReasoningEffortModelId,
|
|
28
29
|
isKimiK3ModelId,
|
|
29
30
|
isMimoModelIdOrName,
|
|
@@ -62,9 +63,9 @@ const GEMINI_3_FLASH_EFFORTS: readonly Effort[] = [Effort.Minimal, Effort.Low, E
|
|
|
62
63
|
const GPT_5_2_PLUS_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High, Effort.XHigh];
|
|
63
64
|
const GPT_5_1_CODEX_MINI_EFFORTS: readonly Effort[] = [Effort.Medium, Effort.High];
|
|
64
65
|
const LOW_MEDIUM_HIGH_REASONING_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High];
|
|
65
|
-
/** Wire-exact `low`/`high`/`max` scale used by Kimi K3 and
|
|
66
|
+
/** Wire-exact `low`/`high`/`max` scale used by Kimi K3 and DeepSeek V4 Flash (direct API and aggregators). */
|
|
66
67
|
const LOW_HIGH_MAX_REASONING_EFFORTS: readonly Effort[] = [Effort.Low, Effort.High, Effort.Max];
|
|
67
|
-
/** Wire-exact two-tier scale (`high`/`max`): GLM-5.2 on Z.ai/Umans/Ollama Cloud/Baseten, Sakana Fugu, DeepSeek. */
|
|
68
|
+
/** Wire-exact two-tier scale (`high`/`max`): GLM-5.2 on Z.ai/Umans/Ollama Cloud/Baseten, Sakana Fugu, DeepSeek V4 Pro. */
|
|
68
69
|
const HIGH_MAX_REASONING_EFFORTS: readonly Effort[] = [Effort.High, Effort.Max];
|
|
69
70
|
/** OpenRouter's DeepSeek route accepts only `high`. */
|
|
70
71
|
const HIGH_ONLY_REASONING_EFFORTS: readonly Effort[] = [Effort.High];
|
|
@@ -366,14 +367,14 @@ function getModelDefinedEfforts<TApi extends Api>(
|
|
|
366
367
|
return OLLAMA_REASONING_EFFORTS;
|
|
367
368
|
}
|
|
368
369
|
if (isOpenAICompatReasoningApi(spec.api) && isDeepseekReasoningModel(spec)) {
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
370
|
+
// DeepSeek V4 Flash accepts the wire-exact low/high/max ladder on every
|
|
371
|
+
// host — the direct API and aggregators alike (medium/xhigh map to
|
|
372
|
+
// high). V4 Pro and the older reasoners top out at high/max, and
|
|
373
|
+
// OpenRouter's non-flash DeepSeek route exposes only high.
|
|
374
|
+
if (isDeepseekV4FlashModelId(spec.id)) {
|
|
375
|
+
return LOW_HIGH_MAX_REASONING_EFFORTS;
|
|
375
376
|
}
|
|
376
|
-
return HIGH_MAX_REASONING_EFFORTS;
|
|
377
|
+
return isOpenRouterThinkingFormat(compat) ? HIGH_ONLY_REASONING_EFFORTS : HIGH_MAX_REASONING_EFFORTS;
|
|
377
378
|
}
|
|
378
379
|
if (spec.provider === "baseten" && isOpenAIGptOssModelId(spec.id)) {
|
|
379
380
|
// Baseten's gpt-oss router mirrors its GLM route: high/max only.
|
|
@@ -2834,6 +2834,64 @@ export const ALIBABA_TOKEN_PLAN_STATIC_MODELS: readonly ModelSpec<"openai-comple
|
|
|
2834
2834
|
},
|
|
2835
2835
|
];
|
|
2836
2836
|
|
|
2837
|
+
/**
|
|
2838
|
+
* Metadata for Alibaba Token Plan models that are dynamically discovered but not
|
|
2839
|
+
* in the static catalog. Context window and max tokens are sourced from
|
|
2840
|
+
* official model documentation and provider catalogs. Unknown future models
|
|
2841
|
+
* remain available with null limits instead of assigning unsafe guessed limits.
|
|
2842
|
+
*/
|
|
2843
|
+
export interface AlibabaTokenPlanModelLimits {
|
|
2844
|
+
contextWindow: number;
|
|
2845
|
+
maxTokens: number;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
export const ALIBABA_TOKEN_PLAN_DISCOVERED_MODEL_LIMITS: Readonly<Record<string, AlibabaTokenPlanModelLimits>> = {
|
|
2849
|
+
"qwen3.6-plus": {
|
|
2850
|
+
contextWindow: 1_000_000,
|
|
2851
|
+
maxTokens: 65_536,
|
|
2852
|
+
},
|
|
2853
|
+
"qwen3.8-max": {
|
|
2854
|
+
contextWindow: 1_000_000,
|
|
2855
|
+
maxTokens: 131_072,
|
|
2856
|
+
},
|
|
2857
|
+
"deepseek-v4-flash": {
|
|
2858
|
+
contextWindow: 1_000_000,
|
|
2859
|
+
maxTokens: 384_000,
|
|
2860
|
+
},
|
|
2861
|
+
"deepseek-v4-flash-0731": {
|
|
2862
|
+
contextWindow: 1_000_000,
|
|
2863
|
+
maxTokens: 384_000,
|
|
2864
|
+
},
|
|
2865
|
+
"deepseek-v3.2": {
|
|
2866
|
+
contextWindow: 131_072,
|
|
2867
|
+
maxTokens: 65_536,
|
|
2868
|
+
},
|
|
2869
|
+
"glm-5.1": {
|
|
2870
|
+
contextWindow: 202_752,
|
|
2871
|
+
maxTokens: 128_000,
|
|
2872
|
+
},
|
|
2873
|
+
"glm-5": {
|
|
2874
|
+
contextWindow: 202_752,
|
|
2875
|
+
maxTokens: 16_384,
|
|
2876
|
+
},
|
|
2877
|
+
"kimi-k2.7-code": {
|
|
2878
|
+
contextWindow: 262_144,
|
|
2879
|
+
maxTokens: 262_144,
|
|
2880
|
+
},
|
|
2881
|
+
"kimi-k2.6": {
|
|
2882
|
+
contextWindow: 262_144,
|
|
2883
|
+
maxTokens: 262_144,
|
|
2884
|
+
},
|
|
2885
|
+
"kimi-k2.5": {
|
|
2886
|
+
contextWindow: 262_144,
|
|
2887
|
+
maxTokens: 98_304,
|
|
2888
|
+
},
|
|
2889
|
+
"minimax-m2.5": {
|
|
2890
|
+
contextWindow: 196_608,
|
|
2891
|
+
maxTokens: 32_768,
|
|
2892
|
+
},
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2837
2895
|
const ALIBABA_TOKEN_PLAN_NON_CHAT_MODEL_PREFIXES = [
|
|
2838
2896
|
"fun-asr",
|
|
2839
2897
|
"happyhorse-",
|
|
@@ -2888,10 +2946,19 @@ export function alibabaTokenPlanModelManagerOptions(
|
|
|
2888
2946
|
baseUrl: defaults.baseUrl,
|
|
2889
2947
|
};
|
|
2890
2948
|
}
|
|
2891
|
-
|
|
2892
|
-
|
|
2949
|
+
const normalizedId = defaults.id.trim().toLowerCase();
|
|
2950
|
+
const limits = ALIBABA_TOKEN_PLAN_DISCOVERED_MODEL_LIMITS[normalizedId];
|
|
2951
|
+
const enriched = limits
|
|
2952
|
+
? {
|
|
2953
|
+
...defaults,
|
|
2954
|
+
contextWindow: limits.contextWindow,
|
|
2955
|
+
maxTokens: limits.maxTokens,
|
|
2956
|
+
}
|
|
2957
|
+
: defaults;
|
|
2958
|
+
|
|
2959
|
+
if (normalizedId.startsWith("deepseek-v4")) {
|
|
2893
2960
|
return {
|
|
2894
|
-
...
|
|
2961
|
+
...enriched,
|
|
2895
2962
|
reasoning: true,
|
|
2896
2963
|
thinking: {
|
|
2897
2964
|
mode: "effort" as const,
|
|
@@ -2899,7 +2966,7 @@ export function alibabaTokenPlanModelManagerOptions(
|
|
|
2899
2966
|
},
|
|
2900
2967
|
};
|
|
2901
2968
|
}
|
|
2902
|
-
return
|
|
2969
|
+
return enriched;
|
|
2903
2970
|
},
|
|
2904
2971
|
fetch: config?.fetch,
|
|
2905
2972
|
}),
|
package/src/types.ts
CHANGED
|
@@ -518,6 +518,12 @@ export interface BedrockCompat {
|
|
|
518
518
|
* Capability metadata only; zero means no explicit checkpoints.
|
|
519
519
|
*/
|
|
520
520
|
promptCacheMaximumCheckpoints?: number;
|
|
521
|
+
/**
|
|
522
|
+
* Stream-watchdog idle-timeout fallback in ms; 0 disables the idle watchdog.
|
|
523
|
+
* Undefined defers to `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
|
|
524
|
+
* `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then the 300s default.
|
|
525
|
+
*/
|
|
526
|
+
streamIdleTimeoutMs?: number;
|
|
521
527
|
}
|
|
522
528
|
|
|
523
529
|
/** Fully-resolved Bedrock Converse prompt-cache capabilities, materialized once by `buildModel`. */
|
|
@@ -526,6 +532,13 @@ export interface ResolvedBedrockCompat {
|
|
|
526
532
|
supportsLongPromptCacheRetention: boolean;
|
|
527
533
|
promptCacheMinimumTokens: number;
|
|
528
534
|
promptCacheMaximumCheckpoints: number;
|
|
535
|
+
/**
|
|
536
|
+
* Stream-watchdog idle-timeout fallback in ms for hosts with no keepalive
|
|
537
|
+
* events; 0 disables the idle watchdog. Undefined defers to
|
|
538
|
+
* `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
|
|
539
|
+
* `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then the 300s default.
|
|
540
|
+
*/
|
|
541
|
+
streamIdleTimeoutMs?: number;
|
|
529
542
|
}
|
|
530
543
|
|
|
531
544
|
/**
|
package/src/variant-collapse.ts
CHANGED
|
@@ -115,7 +115,7 @@ type DevinTierRoutes = Partial<Record<"off" | "minimal" | "low" | "medium" | "hi
|
|
|
115
115
|
|
|
116
116
|
/** Devin families with a `-max` sibling: five wire tiers, `low` floor. */
|
|
117
117
|
const DEVIN_FIVE_TIER_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High, Effort.XHigh, Effort.Max];
|
|
118
|
-
/** Devin families
|
|
118
|
+
/** Pre-5.6 Devin GPT families top out at `-xhigh`: four wire tiers, `low` floor. */
|
|
119
119
|
const DEVIN_FOUR_TIER_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High, Effort.XHigh];
|
|
120
120
|
|
|
121
121
|
function devinTierFamily(
|
|
@@ -172,8 +172,7 @@ function devinTierFamily(
|
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* GPT-5.6 (Luna/Sol/Terra) serves per-tier siblings for the full five-tier
|
|
175
|
-
* `low..max` wire scale
|
|
176
|
-
* `-max-priority` sibling, so the fast family tops out at `xhigh`.
|
|
175
|
+
* `low..max` wire scale in both standard and fast lanes.
|
|
177
176
|
*/
|
|
178
177
|
function devinGpt56Families(variant: "luna" | "sol" | "terra", name: string): readonly EffortVariantFamily[] {
|
|
179
178
|
const base = `gpt-5-6-${variant}`;
|
|
@@ -200,8 +199,9 @@ function devinGpt56Families(variant: "luna" | "sol" | "terra", name: string): re
|
|
|
200
199
|
medium: `${base}-medium-priority`,
|
|
201
200
|
high: `${base}-high-priority`,
|
|
202
201
|
xhigh: `${base}-xhigh-priority`,
|
|
202
|
+
max: `${base}-max-priority`,
|
|
203
203
|
},
|
|
204
|
-
|
|
204
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
205
205
|
),
|
|
206
206
|
];
|
|
207
207
|
}
|
|
@@ -378,6 +378,54 @@ export const GEMINI_CLI_VARIANT_COLLAPSE_TABLE: VariantCollapseTable = {
|
|
|
378
378
|
};
|
|
379
379
|
export const DEVIN_VARIANT_COLLAPSE_TABLE: VariantCollapseTable = {
|
|
380
380
|
families: [
|
|
381
|
+
devinTierFamily(
|
|
382
|
+
"claude-opus-5",
|
|
383
|
+
"Claude Opus 5",
|
|
384
|
+
{
|
|
385
|
+
low: "claude-opus-5-low",
|
|
386
|
+
medium: "claude-opus-5-medium",
|
|
387
|
+
high: "claude-opus-5-high",
|
|
388
|
+
xhigh: "claude-opus-5-xhigh",
|
|
389
|
+
max: "claude-opus-5-max",
|
|
390
|
+
},
|
|
391
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
392
|
+
),
|
|
393
|
+
devinTierFamily(
|
|
394
|
+
"claude-opus-5-fast",
|
|
395
|
+
"Claude Opus 5 Fast",
|
|
396
|
+
{
|
|
397
|
+
low: "claude-opus-5-low-fast",
|
|
398
|
+
medium: "claude-opus-5-medium-fast",
|
|
399
|
+
high: "claude-opus-5-high-fast",
|
|
400
|
+
xhigh: "claude-opus-5-xhigh-fast",
|
|
401
|
+
max: "claude-opus-5-max-fast",
|
|
402
|
+
},
|
|
403
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
404
|
+
),
|
|
405
|
+
devinTierFamily(
|
|
406
|
+
"claude-fable-5",
|
|
407
|
+
"Claude Fable 5",
|
|
408
|
+
{
|
|
409
|
+
low: "claude-5-fable-low",
|
|
410
|
+
medium: "claude-5-fable-medium",
|
|
411
|
+
high: "claude-5-fable-high",
|
|
412
|
+
xhigh: "claude-5-fable-xhigh",
|
|
413
|
+
max: "claude-5-fable-max",
|
|
414
|
+
},
|
|
415
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
416
|
+
),
|
|
417
|
+
devinTierFamily(
|
|
418
|
+
"claude-sonnet-5",
|
|
419
|
+
"Claude Sonnet 5",
|
|
420
|
+
{
|
|
421
|
+
low: "claude-sonnet-5-low",
|
|
422
|
+
medium: "claude-sonnet-5-medium",
|
|
423
|
+
high: "claude-sonnet-5-high",
|
|
424
|
+
xhigh: "claude-sonnet-5-xhigh",
|
|
425
|
+
max: "claude-sonnet-5-max",
|
|
426
|
+
},
|
|
427
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
428
|
+
),
|
|
381
429
|
devinTierFamily(
|
|
382
430
|
"claude-opus-4-7",
|
|
383
431
|
"Claude Opus 4.7",
|
|
@@ -522,6 +570,48 @@ export const DEVIN_VARIANT_COLLAPSE_TABLE: VariantCollapseTable = {
|
|
|
522
570
|
...devinGpt56Families("luna", "GPT-5.6 Luna"),
|
|
523
571
|
...devinGpt56Families("sol", "GPT-5.6 Sol"),
|
|
524
572
|
...devinGpt56Families("terra", "GPT-5.6 Terra"),
|
|
573
|
+
devinTierFamily(
|
|
574
|
+
"kimi-k3",
|
|
575
|
+
"Kimi K3",
|
|
576
|
+
{
|
|
577
|
+
low: "kimi-k3-low",
|
|
578
|
+
high: "kimi-k3-high",
|
|
579
|
+
max: "kimi-k3-max",
|
|
580
|
+
},
|
|
581
|
+
[Effort.Low, Effort.High, Effort.Max],
|
|
582
|
+
),
|
|
583
|
+
devinTierFamily(
|
|
584
|
+
"swe-1-7",
|
|
585
|
+
"SWE-1.7",
|
|
586
|
+
{
|
|
587
|
+
medium: "swe-1-7-medium",
|
|
588
|
+
max: "swe-1-7",
|
|
589
|
+
},
|
|
590
|
+
[Effort.Medium, Effort.Max],
|
|
591
|
+
),
|
|
592
|
+
devinTierFamily(
|
|
593
|
+
"grok-4-5",
|
|
594
|
+
"Grok 4.5",
|
|
595
|
+
{
|
|
596
|
+
low: "grok-4-5-low",
|
|
597
|
+
medium: "grok-4-5-medium",
|
|
598
|
+
high: "grok-4-5-high",
|
|
599
|
+
},
|
|
600
|
+
[Effort.Low, Effort.Medium, Effort.High],
|
|
601
|
+
),
|
|
602
|
+
devinTierFamily(
|
|
603
|
+
"inkling",
|
|
604
|
+
"Inkling",
|
|
605
|
+
{
|
|
606
|
+
off: "inkling-none",
|
|
607
|
+
low: "inkling-low",
|
|
608
|
+
medium: "inkling-medium",
|
|
609
|
+
high: "inkling-high",
|
|
610
|
+
xhigh: "inkling-xhigh",
|
|
611
|
+
max: "inkling-max",
|
|
612
|
+
},
|
|
613
|
+
DEVIN_FIVE_TIER_EFFORTS,
|
|
614
|
+
),
|
|
525
615
|
devinTierFamily(
|
|
526
616
|
"gemini-3-1-pro",
|
|
527
617
|
"Gemini 3.1 Pro",
|
|
@@ -542,6 +632,17 @@ export const DEVIN_VARIANT_COLLAPSE_TABLE: VariantCollapseTable = {
|
|
|
542
632
|
},
|
|
543
633
|
[Effort.Minimal, Effort.Low, Effort.Medium, Effort.High],
|
|
544
634
|
),
|
|
635
|
+
devinTierFamily(
|
|
636
|
+
"gemini-3-6-flash",
|
|
637
|
+
"Gemini 3.6 Flash",
|
|
638
|
+
{
|
|
639
|
+
minimal: "gemini-3-6-flash-minimal",
|
|
640
|
+
low: "gemini-3-6-flash-low",
|
|
641
|
+
medium: "gemini-3-6-flash-medium",
|
|
642
|
+
high: "gemini-3-6-flash-high",
|
|
643
|
+
},
|
|
644
|
+
[Effort.Minimal, Effort.Low, Effort.Medium, Effort.High],
|
|
645
|
+
),
|
|
545
646
|
devinTierFamily(
|
|
546
647
|
"gemini-3-flash",
|
|
547
648
|
"Gemini 3 Flash",
|