Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(tasks): read the 1M context and fast mode flags from the catalog (#105701)

Vojta Bartošc73790a20f98
diff --git a/products/desktop/packages/shared/src/index.ts b/products/desktop/packages/shared/src/index.ts
index 618624adafbe..cc1a582b8a30 100644
--- a/products/desktop/packages/shared/src/index.ts
+++ b/products/desktop/packages/shared/src/index.ts
@@ -233,6 +233,7 @@ export {
formatMention,
splitMentionSegments,
} from "./mentions";
+export { supports1MContext, supportsFastMode } from "./model-catalog";
export {
customModelMeta,
DEFAULT_OPTION_META_KEY,
@@ -308,8 +309,6 @@ export {
getReasoningEffortOptions,
isSupportedReasoningEffort,
type SupportedReasoningEffort,
- supports1MContext,
- supportsFastMode,
} from "./reasoning-effort";
export { REFUND_REASON_OPTIONS } from "./refund-reasons";
export {
diff --git a/products/desktop/packages/shared/src/model-catalog.generated.ts b/products/desktop/packages/shared/src/model-catalog.generated.ts
index fa156aebd6b9..99086e89bcd1 100644
--- a/products/desktop/packages/shared/src/model-catalog.generated.ts
+++ b/products/desktop/packages/shared/src/model-catalog.generated.ts
@@ -99,6 +99,12 @@ export interface CatalogModel {
/** The rates behind the multiplier, ready to render. Absent whenever
`cost` is. */
costSummary?: string;
+ /** Runs with the 1M-token context window. Absent means it does not, and a
+ picker offers no window choice. */
+ supports1MContext?: boolean;
+ /** Runs in fast mode. Absent means it does not, and a picker offers no
+ fast-mode toggle. */
+ supportsFastMode?: boolean;
}
/** The model `1×` refers to. */
@@ -210,6 +216,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "2.5×",
costSummary: "Input $5 · Output $25 per 1M tokens",
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: "claude-opus-4-8",
@@ -222,6 +230,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "2.5×",
costSummary: "Input $5 · Output $25 per 1M tokens",
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: "claude-opus-5",
@@ -234,6 +244,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "2.5×",
costSummary: "Input $5 · Output $25 per 1M tokens",
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: "claude-opus-5-5",
@@ -246,6 +258,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "2×",
costSummary: "Input $4 · Output $20 per 1M tokens",
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: "claude-fable-5",
@@ -258,6 +272,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "5×",
costSummary: "Input $10 · Output $50 per 1M tokens",
+ supports1MContext: true,
},
{
id: "claude-fable-5-1",
@@ -270,6 +285,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "5×",
costSummary: "Input $10 · Output $50 per 1M tokens",
+ supports1MContext: true,
},
{
id: "claude-sonnet-5",
@@ -282,6 +298,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "1×",
costSummary: "Input $2 · Output $10 per 1M tokens",
+ supports1MContext: true,
},
{
id: "claude-sonnet-4-6",
@@ -294,6 +311,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: "1.5×",
costSummary: "Input $3 · Output $15 per 1M tokens",
+ supports1MContext: true,
},
{
id: "gpt-5",
diff --git a/products/desktop/packages/shared/src/model-catalog.ts b/products/desktop/packages/shared/src/model-catalog.ts
index d0418db1b527..25931ae66593 100644
--- a/products/desktop/packages/shared/src/model-catalog.ts
+++ b/products/desktop/packages/shared/src/model-catalog.ts
@@ -116,3 +116,11 @@ export function accessFlagForModel(modelId: string): string | undefined {
export function labelForModel(modelId: string): string | undefined {
return catalogModelFor(modelId)?.label;
}
+
+export function supports1MContext(modelId: string): boolean {
+ return catalogModelFor(modelId)?.supports1MContext ?? false;
+}
+
+export function supportsFastMode(modelId: string): boolean {
+ return catalogModelFor(modelId)?.supportsFastMode ?? false;
+}
diff --git a/products/desktop/packages/shared/src/reasoning-effort.ts b/products/desktop/packages/shared/src/reasoning-effort.ts
index a6667c664583..cb2b8b5b3467 100644
--- a/products/desktop/packages/shared/src/reasoning-effort.ts
+++ b/products/desktop/packages/shared/src/reasoning-effort.ts
@@ -1,6 +1,6 @@
import type { Adapter } from "./adapter";
import { EFFORT_LEVEL_LABELS, type EffortLevel } from "./domain-types";
-import { normalizeModelId, reasoningEffortsForModel } from "./model-catalog";
+import { reasoningEffortsForModel } from "./model-catalog";
import {
CAPABILITY_LADDER_BY_RUNTIME_ADAPTER,
type CapabilityNotch,
@@ -45,31 +45,3 @@ export function getCapabilityLadder(
): readonly CapabilityNotch[] {
return CAPABILITY_LADDER_BY_RUNTIME_ADAPTER[adapter];
}
-
-const MODELS_WITH_1M_CONTEXT = new Set([
- "claude-opus-4-7",
- "claude-opus-4-8",
- "claude-opus-5",
- "claude-opus-5-5",
- "claude-sonnet-4-6",
- "claude-sonnet-5",
- "claude-fable-5",
- "claude-fable-5-1",
-]);
-
-// Normalized like the effort lookup above: the gateway serves some ids provider-qualified,
-// and a raw check here would silently drop the model to 200k.
-export function supports1MContext(modelId: string): boolean {
- return MODELS_WITH_1M_CONTEXT.has(normalizeModelId(modelId));
-}
-
-const MODELS_WITH_FAST_MODE = new Set([
- "claude-opus-4-7",
- "claude-opus-4-8",
- "claude-opus-5",
- "claude-opus-5-5",
-]);
-
-export function supportsFastMode(modelId: string): boolean {
- return MODELS_WITH_FAST_MODE.has(normalizeModelId(modelId));
-}
diff --git a/products/tasks/backend/model_catalog.py b/products/tasks/backend/model_catalog.py
index 9c0e54388afa..ca65f69eddb1 100644
--- a/products/tasks/backend/model_catalog.py
+++ b/products/tasks/backend/model_catalog.py
@@ -123,6 +123,11 @@ class CatalogModel:
``cost`` is ``None`` where no public price list covers the model, and a picker then shows
it with no cost rather than a guessed one.
+ ``supports_1m_context`` and ``supports_fast_mode`` are the two run options a model either
+ takes or rejects. A surface offers the toggle only where the model answers yes, and drops
+ the option from the request everywhere else, so a model that never learns it here runs at
+ the default context window with fast mode off.
+
Both gates fail closed, so clear ``access_flag`` when the rollout reaches everyone. A flag
left behind keeps the model away from every caller the flag service cannot answer for, and
from every surface that reads flags before they load.
@@ -134,6 +139,8 @@ class CatalogModel:
label: str | None = None
access_flag: str | None = None
cost: ModelCost | None = None
+ supports_1m_context: bool = False
+ supports_fast_mode: bool = False
# Rates a model family lists at. Sources, checked 2026-09-17: Anthropic and OpenAI publish
@@ -173,14 +180,42 @@ MODELS: tuple[CatalogModel, ...] = (
),
CatalogModel("claude-opus-4-5", CLAUDE, _STANDARD, cost=_OPUS_COST),
CatalogModel("claude-opus-4-6", CLAUDE, _THROUGH_MAX, cost=_OPUS_COST),
- CatalogModel("claude-opus-4-7", CLAUDE, _EXTENDED, cost=_OPUS_COST),
- CatalogModel("claude-opus-4-8", CLAUDE, _EXTENDED, cost=_OPUS_COST),
- CatalogModel("claude-opus-5", CLAUDE, _EXTENDED, cost=_OPUS_COST),
- CatalogModel("claude-opus-5-5", CLAUDE, _EXTENDED, cost=_OPUS_5_5_COST),
- CatalogModel("claude-fable-5", CLAUDE, _EXTENDED, cost=_FABLE_COST),
- CatalogModel("claude-fable-5-1", CLAUDE, _EXTENDED, cost=_FABLE_COST),
- CatalogModel("claude-sonnet-5", CLAUDE, _EXTENDED, cost=_SONNET_COST),
- CatalogModel("claude-sonnet-4-6", CLAUDE, _STANDARD, cost=_SONNET_4_COST),
+ CatalogModel(
+ "claude-opus-4-7",
+ CLAUDE,
+ _EXTENDED,
+ cost=_OPUS_COST,
+ supports_1m_context=True,
+ supports_fast_mode=True,
+ ),
+ CatalogModel(
+ "claude-opus-4-8",
+ CLAUDE,
+ _EXTENDED,
+ cost=_OPUS_COST,
+ supports_1m_context=True,
+ supports_fast_mode=True,
+ ),
+ CatalogModel(
+ "claude-opus-5",
+ CLAUDE,
+ _EXTENDED,
+ cost=_OPUS_COST,
+ supports_1m_context=True,
+ supports_fast_mode=True,
+ ),
+ CatalogModel(
+ "claude-opus-5-5",
+ CLAUDE,
+ _EXTENDED,
+ cost=_OPUS_5_5_COST,
+ supports_1m_context=True,
+ supports_fast_mode=True,
+ ),
+ CatalogModel("claude-fable-5", CLAUDE, _EXTENDED, cost=_FABLE_COST, supports_1m_context=True),
+ CatalogModel("claude-fable-5-1", CLAUDE, _EXTENDED, cost=_FABLE_COST, supports_1m_context=True),
+ CatalogModel("claude-sonnet-5", CLAUDE, _EXTENDED, cost=_SONNET_COST, supports_1m_context=True),
+ CatalogModel("claude-sonnet-4-6", CLAUDE, _STANDARD, cost=_SONNET_4_COST, supports_1m_context=True),
# No cost: the gateway does not serve bare `gpt-5` to a task run, so there is no rate
# anyone can check it against.
CatalogModel("gpt-5", CODEX, _STANDARD),
@@ -317,6 +352,18 @@ def access_flag_for_model(model_id: str) -> str | None:
return model.access_flag if model else None
+def supports_1m_context(model_id: str) -> bool:
+ """Whether this model runs with the 1M-token context window, ``False`` for one the catalog omits."""
+ model = _MODEL_BY_ID.get(normalize_model_id(model_id))
+ return model.supports_1m_context if model else False
+
+
+def supports_fast_mode(model_id: str) -> bool:
+ """Whether this model runs in fast mode, ``False`` for one the catalog omits."""
+ model = _MODEL_BY_ID.get(normalize_model_id(model_id))
+ return model.supports_fast_mode if model else False
+
+
def label_for_model(model_id: str) -> str | None:
"""The name this catalog pins for a model id, or ``None`` to let the caller derive one."""
model = _MODEL_BY_ID.get(normalize_model_id(model_id))
@@ -484,4 +531,6 @@ __all__ = [
"reasoning_efforts_for",
"runtime_adapter_for_model",
"serves_model",
+ "supports_1m_context",
+ "supports_fast_mode",
]
diff --git a/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json b/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
index 3d94291d9ba3..e3eb11f75617 100644
--- a/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
+++ b/products/tasks/backend/tests/__snapshots__/test_model_catalog/test_every_model_resolves_to_the_recorded_triple.json
@@ -131,7 +131,9 @@
"reasoning_efforts": [
"high",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"claude-fable-5": {
"cost_multiplier": "5×",
@@ -142,7 +144,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": false
},
"claude-fable-5-1": {
"cost_multiplier": "5×",
@@ -153,7 +157,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": false
},
"claude-opus-4-5": {
"cost_multiplier": "2.5×",
@@ -161,7 +167,9 @@
"low",
"medium",
"high"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"claude-opus-4-6": {
"cost_multiplier": "2.5×",
@@ -171,7 +179,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"claude-opus-4-7": {
"cost_multiplier": "2.5×",
@@ -182,7 +192,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": true
},
"claude-opus-4-8": {
"cost_multiplier": "2.5×",
@@ -193,7 +205,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": true
},
"claude-opus-5": {
"cost_multiplier": "2.5×",
@@ -204,7 +218,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": true
},
"claude-opus-5-5": {
"cost_multiplier": "2×",
@@ -215,7 +231,9 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": true
},
"claude-sonnet-4-6": {
"cost_multiplier": "1.5×",
@@ -223,7 +241,9 @@
"low",
"medium",
"high"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": false
},
"claude-sonnet-5": {
"cost_multiplier": "1×",
@@ -234,29 +254,39 @@
"xhigh",
"max",
"ultracode"
- ]
+ ],
+ "supports_1m_context": true,
+ "supports_fast_mode": false
},
"deepseek-ai/deepseek-v4-flash-0731": {
"cost_multiplier": "≈0.05×",
- "reasoning_efforts": []
+ "reasoning_efforts": [],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"moonshotai/kimi-k3": {
"cost_multiplier": "1.5×",
- "reasoning_efforts": []
+ "reasoning_efforts": [],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"zai-org/glm-5.3": {
"cost_multiplier": "≈0.57×",
"reasoning_efforts": [
"high",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"zai-org/glm-5.3-flash": {
"cost_multiplier": "≈0.06×",
"reasoning_efforts": [
"high",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
}
},
"provider": "anthropic"
@@ -275,7 +305,9 @@
"low",
"medium",
"high"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-5.5": {
"cost_multiplier": "≈2.8×",
@@ -284,7 +316,9 @@
"medium",
"high",
"xhigh"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-5.6-luna": {
"cost_multiplier": "≈0.55×",
@@ -294,7 +328,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-5.6-sol": {
"cost_multiplier": "≈2.8×",
@@ -304,7 +340,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-5.6-terra": {
"cost_multiplier": "≈1.4×",
@@ -314,7 +352,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-6-astra": {
"cost_multiplier": "5×",
@@ -324,7 +364,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-6-luna": {
"cost_multiplier": "0.05×",
@@ -334,7 +376,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
},
"gpt-6-sol": {
"cost_multiplier": "1×",
@@ -344,7 +388,9 @@
"high",
"xhigh",
"max"
- ]
+ ],
+ "supports_1m_context": false,
+ "supports_fast_mode": false
}
},
"provider": "openai"
diff --git a/products/tasks/backend/tests/test_model_catalog.py b/products/tasks/backend/tests/test_model_catalog.py
index 860944b53fda..a0aae8dc4e10 100644
--- a/products/tasks/backend/tests/test_model_catalog.py
+++ b/products/tasks/backend/tests/test_model_catalog.py
@@ -53,6 +53,8 @@ def _resolved_catalog() -> dict[str, Any]:
model_id: {
"reasoning_efforts": list(model_catalog.reasoning_efforts_for(adapter, model_id)),
"cost_multiplier": model_catalog.cost_multiplier_label(model_id),
+ "supports_1m_context": model_catalog.supports_1m_context(model_id),
+ "supports_fast_mode": model_catalog.supports_fast_mode(model_id),
}
for model_id in model_catalog.models_for_runtime_adapter(adapter)
},
diff --git a/products/tasks/frontend/modelCatalog.generated.ts b/products/tasks/frontend/modelCatalog.generated.ts
index cb4625689d76..92e5091c5a3b 100644
--- a/products/tasks/frontend/modelCatalog.generated.ts
+++ b/products/tasks/frontend/modelCatalog.generated.ts
@@ -86,6 +86,12 @@ export interface CatalogModel {
/** The rates behind the multiplier, ready to render. Absent whenever
`cost` is. */
costSummary?: string
+ /** Runs with the 1M-token context window. Absent means it does not, and a
+ picker offers no window choice. */
+ supports1MContext?: boolean
+ /** Runs in fast mode. Absent means it does not, and a picker offers no
+ fast-mode toggle. */
+ supportsFastMode?: boolean
}
/** The model `1×` refers to. */
@@ -197,6 +203,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '2.5×',
costSummary: 'Input $5 · Output $25 per 1M tokens',
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: 'claude-opus-4-8',
@@ -209,6 +217,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '2.5×',
costSummary: 'Input $5 · Output $25 per 1M tokens',
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: 'claude-opus-5',
@@ -221,6 +231,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '2.5×',
costSummary: 'Input $5 · Output $25 per 1M tokens',
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: 'claude-opus-5-5',
@@ -233,6 +245,8 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '2×',
costSummary: 'Input $4 · Output $20 per 1M tokens',
+ supports1MContext: true,
+ supportsFastMode: true,
},
{
id: 'claude-fable-5',
@@ -245,6 +259,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '5×',
costSummary: 'Input $10 · Output $50 per 1M tokens',
+ supports1MContext: true,
},
{
id: 'claude-fable-5-1',
@@ -257,6 +272,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '5×',
costSummary: 'Input $10 · Output $50 per 1M tokens',
+ supports1MContext: true,
},
{
id: 'claude-sonnet-5',
@@ -269,6 +285,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '1×',
costSummary: 'Input $2 · Output $10 per 1M tokens',
+ supports1MContext: true,
},
{
id: 'claude-sonnet-4-6',
@@ -281,6 +298,7 @@ export const MODELS: readonly CatalogModel[] = [
},
costMultiplier: '1.5×',
costSummary: 'Input $3 · Output $15 per 1M tokens',
+ supports1MContext: true,
},
{
id: 'gpt-5',
diff --git a/products/tasks/scripts/build_model_catalog.py b/products/tasks/scripts/build_model_catalog.py
index 76213757fa4d..345b5ab0ecd7 100755
--- a/products/tasks/scripts/build_model_catalog.py
+++ b/products/tasks/scripts/build_model_catalog.py
@@ -146,6 +146,8 @@ def render(catalog: dict[str, Any], style: Style) -> str:
f"{i}{i}label: {style.s(display_name(model.id))},",
*([f"{i}{i}accessFlag: {style.s(model.access_flag)},"] if model.access_flag else []),
*cost_lines(model),
+ *([f"{i}{i}supports1MContext: true,"] if model.supports_1m_context else []),
+ *([f"{i}{i}supportsFastMode: true,"] if model.supports_fast_mode else []),
f"{i}}},",
]
)
@@ -259,6 +261,12 @@ export interface CatalogModel {{
{i}/** The rates behind the multiplier, ready to render. Absent whenever
{i} `cost` is. */
{i}costSummary?: string{semi}
+{i}/** Runs with the 1M-token context window. Absent means it does not, and a
+{i} picker offers no window choice. */
+{i}supports1MContext?: boolean{semi}
+{i}/** Runs in fast mode. Absent means it does not, and a picker offers no
+{i} fast-mode toggle. */
+{i}supportsFastMode?: boolean{semi}
}}
/** The model `1×` refers to. */