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): warm cloud sandbox on selected runtime, match on submit (#66099)

Alessandro Pogliaghi28f157774cbc
diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.py
index b5e7a37b7c0a..1f75e0dc5f55 100644
--- a/products/tasks/backend/facade/api.py
+++ b/products/tasks/backend/facade/api.py
@@ -2584,6 +2584,9 @@ def create_task(team_id: int, user_id: int | None, *, validated_data: dict) -> c
validated_data.setdefault("origin_product", Task.OriginProduct.USER_CREATED)
warm_branch_provided = "branch" in validated_data
warm_branch = validated_data.pop("branch", None)
+ warm_runtime_adapter = validated_data.pop("runtime_adapter", None)
+ warm_model = validated_data.pop("model", None)
+ warm_reasoning_effort = validated_data.pop("reasoning_effort", None)
if user_id is not None:
validated_data["created_by"] = User.objects.get(id=user_id)
@@ -2594,7 +2597,15 @@ def create_task(team_id: int, user_id: int | None, *, validated_data: dict) -> c
and validated_data.get("repository")
and user_id is not None
):
- warm_run = _find_idling_warm_run(team_id, user_id, repository=validated_data["repository"], branch=warm_branch)
+ warm_run = _find_idling_warm_run(
+ team_id,
+ user_id,
+ repository=validated_data["repository"],
+ branch=warm_branch,
+ runtime_adapter=warm_runtime_adapter,
+ model=warm_model,
+ reasoning_effort=warm_reasoning_effort,
+ )
if warm_run is not None:
warm_task = warm_run.task
message = (validated_data.get("description") or "").strip()
@@ -2831,7 +2842,14 @@ def resolve_team_github_integration_id(team_id: int, github_integration_id: int)
def _find_idling_warm_run(
- team_id: int, user_id: int | None, *, repository: str | None, branch: str | None
+ team_id: int,
+ user_id: int | None,
+ *,
+ repository: str | None,
+ branch: str | None,
+ runtime_adapter: str | None = None,
+ model: str | None = None,
+ reasoning_effort: str | None = None,
) -> TaskRun | None:
"""Most-recent idling pre-warmed Run matching this user's cloud composing selection, or ``None``.
@@ -2841,13 +2859,14 @@ def _find_idling_warm_run(
live Run instead of spawning a second) and lets the normal create+run path transparently reuse a
warm Run on submit. Team + user scoped; branch compared as ``None``-normalized exact match.
- Runs on a hot path (warm fires on every typing debounce), so every predicate is pushed into the
- query — ``await_user_message`` is JSON-queryable (see ``SandboxWarmer.at_capacity``) — and only the
- single most-recent match is fetched.
+ Reuse also requires the warm Run's ``runtime_adapter``/``model``/``reasoning_effort`` to match the
+ requested selection (each ``None``-normalized); a mismatch returns ``None`` so the caller cold-creates
+ on the correct runtime. The repo/branch/``await_user_message`` predicates stay in the query; the
+ runtime selection is matched in Python over the small candidate set.
"""
if user_id is None or not repository:
return None
- return (
+ candidates = (
TaskRun.objects.filter( # nosemgrep: idor-lookup-without-team — team_id filter applied via the task FK below
task__team_id=team_id,
task__created_by_id=user_id,
@@ -2859,9 +2878,15 @@ def _find_idling_warm_run(
)
.exclude(status__in=_TERMINAL_TASK_RUN_STATUSES)
.select_related("task")
- .order_by("-created_at")
- .first()
- )
+ .order_by("-created_at")[:20]
+ )
+ wanted = (runtime_adapter or None, model or None, reasoning_effort or None)
+ for run in candidates:
+ state = run.state or {}
+ have = (state.get("runtime_adapter") or None, state.get("model") or None, state.get("reasoning_effort") or None)
+ if have == wanted:
+ return run
+ return None
def _idling_warm_run_for_task(task: Task) -> TaskRun | None:
@@ -2902,11 +2927,16 @@ def warm_task_sandbox(
repository: str,
github_integration_id: int,
branch: str | None,
+ runtime_adapter: str | None = None,
+ model: str | None = None,
+ reasoning_effort: str | None = None,
) -> contracts.WarmTaskDTO | None:
"""Warm a full idling Run for a Code-app cloud task while the user composes.
Births a draft Task (``USER_CREATED``), then ``SandboxWarmer.warm()`` provisions an interactive
- Run that boots + clones + checks out ``branch`` + starts the agent, then idles awaiting the first
+ Run that boots + clones + checks out ``branch`` + starts the agent on the selected
+ ``runtime_adapter``/``model``/``reasoning_effort`` (carried on the Run state and read by the
+ agent-server at launch, so the sandbox boots on the right runtime), then idles awaiting the first
``user_message``. The Run is dispatched with ``create_pr=True`` so that, once activated on submit,
it completes autonomously and opens a PR like a normal Code-app cloud task.
@@ -2928,8 +2958,20 @@ def warm_task_sandbox(
from products.tasks.backend.logic.services.warm import (
SandboxWarmer, # noqa: PLC0415 — keep warming deps off the api import path
)
+ from products.tasks.backend.temporal.process_task.utils import ( # noqa: PLC0415 — keep temporalio off the api import path
+ RuntimeAdapter,
+ get_provider_for_runtime_adapter,
+ )
- existing = _find_idling_warm_run(team_id, user_id, repository=repository, branch=branch)
+ existing = _find_idling_warm_run(
+ team_id,
+ user_id,
+ repository=repository,
+ branch=branch,
+ runtime_adapter=runtime_adapter,
+ model=model,
+ reasoning_effort=reasoning_effort,
+ )
if existing is not None:
return contracts.WarmTaskDTO(task_id=existing.task_id, run_id=existing.id)
@@ -2948,14 +2990,26 @@ def warm_task_sandbox(
)
assert task.created_by is not None # create_without_run always sets created_by from user_id
+ provider = get_provider_for_runtime_adapter(runtime_adapter)
+ initial_permission_mode = "auto" if runtime_adapter == RuntimeAdapter.CODEX.value else "default"
+ extra_state: dict = {
+ "branch": branch,
+ "initial_permission_mode": initial_permission_mode,
+ "use_modal_network_allowlist": False,
+ }
+ for key, value in {
+ "runtime_adapter": runtime_adapter,
+ "provider": provider.value if provider is not None else None,
+ "model": model,
+ "reasoning_effort": reasoning_effort,
+ }.items():
+ if value is not None:
+ extra_state[key] = value
+
try:
result = SandboxWarmer(task, user=task.created_by).warm(
mode="interactive",
- extra_state={
- "branch": branch,
- "initial_permission_mode": "default",
- "use_modal_network_allowlist": False,
- },
+ extra_state=extra_state,
create_pr=True,
)
except (Throttled, PermissionDenied, QuotaLimitExceeded):
@@ -3004,18 +3058,26 @@ def run_task(
if not resume_from_run_id:
warm_run = _idling_warm_run_for_task(task)
- # Only activate when the requested branch matches the branch the warm Run was provisioned on —
- # otherwise the run would work the wrong branch in the warm sandbox. On mismatch, fall through
- # to the cold path so a fresh run is created for the requested branch.
if warm_run is not None and (branch or None) == (warm_run.branch or None):
- _activate_warm_run(
- warm_run,
- task,
- team_id,
- message=pending_user_message or (task.description or None),
- artifact_ids=validated_data.get("pending_user_artifact_ids") or [],
+ warm_state = warm_run.state or {}
+ warm_runtime_matches = (
+ warm_state.get("runtime_adapter") or None,
+ warm_state.get("model") or None,
+ warm_state.get("reasoning_effort") or None,
+ ) == (
+ validated_data.get("runtime_adapter") or None,
+ validated_data.get("model") or None,
+ validated_data.get("reasoning_effort") or None,
)
- return contracts.TaskRunResult(task=get_task_detail(task.id, team_id, user_id))
+ if warm_runtime_matches:
+ _activate_warm_run(
+ warm_run,
+ task,
+ team_id,
+ message=pending_user_message or (task.description or None),
+ artifact_ids=validated_data.get("pending_user_artifact_ids") or [],
+ )
+ return contracts.TaskRunResult(task=get_task_detail(task.id, team_id, user_id))
pending_user_artifact_ids = validated_data.get("pending_user_artifact_ids") or []
sandbox_environment_id = validated_data.get("sandbox_environment_id")
sandbox_environment_id_supplied_by_user = sandbox_environment_id is not None
diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.py
index 7e6d3bb85f7d..f51c28c51dc2 100644
--- a/products/tasks/backend/presentation/serializers.py
+++ b/products/tasks/backend/presentation/serializers.py
@@ -338,6 +338,31 @@ class TaskWriteSerializer(serializers.Serializer):
"is otherwise carried on the run). Omit to match a warm Run on the default branch."
),
)
+ runtime_adapter = serializers.ChoiceField(
+ choices=[adapter.value for adapter in RuntimeAdapter],
+ required=False,
+ default=None,
+ write_only=True,
+ help_text=(
+ "Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: "
+ "used only to reuse a pre-warmed Run started on the same runtime. A value differing from the "
+ "warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime."
+ ),
+ )
+ model = serializers.CharField(
+ required=False,
+ default=None,
+ allow_blank=False,
+ write_only=True,
+ help_text="Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model.",
+ )
+ reasoning_effort = serializers.ChoiceField(
+ choices=[effort.value for effort in PUBLIC_REASONING_EFFORTS],
+ required=False,
+ default=None,
+ write_only=True,
+ help_text="Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.",
+ )
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@ -1201,6 +1226,28 @@ class WarmTaskRequestSerializer(serializers.Serializer):
max_length=255,
help_text="Branch to check out in the warm sandbox. Defaults to the repository's default branch when omitted.",
)
+ runtime_adapter = serializers.ChoiceField(
+ choices=[adapter.value for adapter in RuntimeAdapter],
+ required=False,
+ default=None,
+ help_text=(
+ "Agent runtime adapter to warm the sandbox on ('claude' or 'codex'). The warm Run starts the "
+ "agent on this runtime so a matching submit reuses it; a submit selecting a different runtime "
+ "falls through to a cold Run instead of reusing a mismatched warm session."
+ ),
+ )
+ model = serializers.CharField(
+ required=False,
+ default=None,
+ allow_blank=False,
+ help_text="LLM model identifier to warm the sandbox on. A submit selecting a different model won't reuse this warm Run.",
+ )
+ reasoning_effort = serializers.ChoiceField(
+ choices=[effort.value for effort in PUBLIC_REASONING_EFFORTS],
+ required=False,
+ default=None,
+ help_text="Reasoning effort to warm the sandbox on for models that expose an effort control.",
+ )
def validate_repository(self, value: str) -> str:
normalized = value.strip().lower()
diff --git a/products/tasks/backend/presentation/views/api.py b/products/tasks/backend/presentation/views/api.py
index ccaaf2cd0e0d..8ebc38f9c123 100644
--- a/products/tasks/backend/presentation/views/api.py
+++ b/products/tasks/backend/presentation/views/api.py
@@ -586,6 +586,9 @@ class TaskViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
repository=request.validated_data["repository"],
github_integration_id=github_integration_id,
branch=request.validated_data.get("branch"),
+ runtime_adapter=request.validated_data.get("runtime_adapter"),
+ model=request.validated_data.get("model"),
+ reasoning_effort=request.validated_data.get("reasoning_effort"),
)
if result is None:
return Response(status=status.HTTP_200_OK)
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index 053e0511dd09..e5e444357fc6 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -394,6 +394,34 @@ export const SignalReportTaskRelationshipEnumApi = {
Implementation: 'implementation',
} as const
+/**
+ * * `claude` - claude
+ * * `codex` - codex
+ */
+export type RuntimeAdapterEnumApi = (typeof RuntimeAdapterEnumApi)[keyof typeof RuntimeAdapterEnumApi]
+
+export const RuntimeAdapterEnumApi = {
+ Claude: 'claude',
+ Codex: 'codex',
+} as const
+
+/**
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max
+ */
+export type ReasoningEffortEnumApi = (typeof ReasoningEffortEnumApi)[keyof typeof ReasoningEffortEnumApi]
+
+export const ReasoningEffortEnumApi = {
+ Low: 'low',
+ Medium: 'medium',
+ High: 'high',
+ Xhigh: 'xhigh',
+ Max: 'max',
+} as const
+
/**
* Request body for creating or updating a task.
*
@@ -464,6 +492,21 @@ export interface TaskWriteApi {
* @nullable
*/
branch?: string | null
+ /** Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnumApi
+ /** Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model. */
+ model?: string
+ /** Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnumApi
}
/**
@@ -536,6 +579,21 @@ export interface PatchedTaskWriteApi {
* @nullable
*/
branch?: string | null
+ /** Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnumApi
+ /** Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model. */
+ model?: string
+ /** Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnumApi
}
/**
@@ -595,23 +653,6 @@ export const ClaudeRuntimeAdapterEnumApi = {
Claude: 'claude',
} as const
-/**
- * * `low` - low
- * * `medium` - medium
- * * `high` - high
- * * `xhigh` - xhigh
- * * `max` - max
- */
-export type ReasoningEffortEnumApi = (typeof ReasoningEffortEnumApi)[keyof typeof ReasoningEffortEnumApi]
-
-export const ReasoningEffortEnumApi = {
- Low: 'low',
- Medium: 'medium',
- High: 'high',
- Xhigh: 'xhigh',
- Max: 'max',
-} as const
-
/**
* * `default` - default
* * `acceptEdits` - acceptEdits
@@ -980,17 +1021,6 @@ export interface TaskStagedArtifactsPrepareUploadResponseApi {
artifacts: TaskStagedArtifactPrepareUploadResponseApi[]
}
-/**
- * * `claude` - claude
- * * `codex` - codex
- */
-export type RuntimeAdapterEnumApi = (typeof RuntimeAdapterEnumApi)[keyof typeof RuntimeAdapterEnumApi]
-
-export const RuntimeAdapterEnumApi = {
- Claude: 'claude',
- Codex: 'codex',
-} as const
-
/**
* * `anthropic` - anthropic
* * `openai` - openai
@@ -1889,6 +1919,21 @@ export interface WarmTaskRequestApi {
* @nullable
*/
branch?: string | null
+ /** Agent runtime adapter to warm the sandbox on ('claude' or 'codex'). The warm Run starts the agent on this runtime so a matching submit reuses it; a submit selecting a different runtime falls through to a cold Run instead of reusing a mismatched warm session.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnumApi
+ /** LLM model identifier to warm the sandbox on. A submit selecting a different model won't reuse this warm Run. */
+ model?: string
+ /** Reasoning effort to warm the sandbox on for models that expose an effort control.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnumApi
}
/**
diff --git a/products/tasks/frontend/generated/api.zod.ts b/products/tasks/frontend/generated/api.zod.ts
index 2694bdb0be4c..c3dd6f269e99 100644
--- a/products/tasks/frontend/generated/api.zod.ts
+++ b/products/tasks/frontend/generated/api.zod.ts
@@ -299,6 +299,26 @@ export const TasksCreateBody = /* @__PURE__ */ zod
.describe(
'Branch the user has selected for this cloud task. Write-only and not persisted on the task itself: used only to reuse a matching pre-warmed sandbox Run on creation (the branch is otherwise carried on the run). Omit to match a warm Run on the default branch.'
),
+ runtime_adapter: zod
+ .enum(['claude', 'codex'])
+ .describe('\* `claude` - claude\n\* `codex` - codex')
+ .optional()
+ .describe(
+ "Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.\n\n\* `claude` - claude\n\* `codex` - codex"
+ ),
+ model: zod
+ .string()
+ .optional()
+ .describe(
+ 'Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model.'
+ ),
+ reasoning_effort: zod
+ .enum(['low', 'medium', 'high', 'xhigh', 'max'])
+ .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max')
+ .optional()
+ .describe(
+ 'Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max'
+ ),
})
.describe(
'Request body for creating or updating a task.\n\nField required\/default semantics match the ``Task`` model. The view passes\n``validated_data`` (integration\/report PK fields already resolved to instances) to the\nfacade ``create_task`` \/ ``update_task`` functions.'
@@ -381,6 +401,26 @@ export const TasksUpdateBody = /* @__PURE__ */ zod
.describe(
'Branch the user has selected for this cloud task. Write-only and not persisted on the task itself: used only to reuse a matching pre-warmed sandbox Run on creation (the branch is otherwise carried on the run). Omit to match a warm Run on the default branch.'
),
+ runtime_adapter: zod
+ .enum(['claude', 'codex'])
+ .describe('\* `claude` - claude\n\* `codex` - codex')
+ .optional()
+ .describe(
+ "Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.\n\n\* `claude` - claude\n\* `codex` - codex"
+ ),
+ model: zod
+ .string()
+ .optional()
+ .describe(
+ 'Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model.'
+ ),
+ reasoning_effort: zod
+ .enum(['low', 'medium', 'high', 'xhigh', 'max'])
+ .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max')
+ .optional()
+ .describe(
+ 'Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max'
+ ),
})
.describe(
'Request body for creating or updating a task.\n\nField required\/default semantics match the ``Task`` model. The view passes\n``validated_data`` (integration\/report PK fields already resolved to instances) to the\nfacade ``create_task`` \/ ``update_task`` functions.'
@@ -463,6 +503,26 @@ export const TasksPartialUpdateBody = /* @__PURE__ */ zod
.describe(
'Branch the user has selected for this cloud task. Write-only and not persisted on the task itself: used only to reuse a matching pre-warmed sandbox Run on creation (the branch is otherwise carried on the run). Omit to match a warm Run on the default branch.'
),
+ runtime_adapter: zod
+ .enum(['claude', 'codex'])
+ .describe('\* `claude` - claude\n\* `codex` - codex')
+ .optional()
+ .describe(
+ "Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.\n\n\* `claude` - claude\n\* `codex` - codex"
+ ),
+ model: zod
+ .string()
+ .optional()
+ .describe(
+ 'Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model.'
+ ),
+ reasoning_effort: zod
+ .enum(['low', 'medium', 'high', 'xhigh', 'max'])
+ .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max')
+ .optional()
+ .describe(
+ 'Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max'
+ ),
})
.describe(
'Request body for creating or updating a task.\n\nField required\/default semantics match the ``Task`` model. The view passes\n``validated_data`` (integration\/report PK fields already resolved to instances) to the\nfacade ``create_task`` \/ ``update_task`` functions.'
@@ -1214,6 +1274,26 @@ export const TasksWarmCreateBody = /* @__PURE__ */ zod
.describe(
"Branch to check out in the warm sandbox. Defaults to the repository's default branch when omitted."
),
+ runtime_adapter: zod
+ .enum(['claude', 'codex'])
+ .describe('\* `claude` - claude\n\* `codex` - codex')
+ .optional()
+ .describe(
+ "Agent runtime adapter to warm the sandbox on ('claude' or 'codex'). The warm Run starts the agent on this runtime so a matching submit reuses it; a submit selecting a different runtime falls through to a cold Run instead of reusing a mismatched warm session.\n\n\* `claude` - claude\n\* `codex` - codex"
+ ),
+ model: zod
+ .string()
+ .optional()
+ .describe(
+ "LLM model identifier to warm the sandbox on. A submit selecting a different model won't reuse this warm Run."
+ ),
+ reasoning_effort: zod
+ .enum(['low', 'medium', 'high', 'xhigh', 'max'])
+ .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max')
+ .optional()
+ .describe(
+ 'Reasoning effort to warm the sandbox on for models that expose an effort control.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `xhigh` - xhigh\n\* `max` - max'
+ ),
})
.describe(
"Request body for warming a full idling Run while composing a Code-app cloud task.\n\nCollection-level: no task exists yet at typing time. The warmer births a draft Task and an\ninteractive Run that boots, clones, checks out `branch`, and starts the agent, then idles awaiting\nthe first message. `github_integration` is a plain integration PK (an integer); the view re-scopes\nit to the caller's team before use."
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 9d64b8e702c2..833c3b5eaa13 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -40942,6 +40942,21 @@ export namespace Schemas {
* @nullable
*/
branch?: string | null;
+ /** Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnum;
+ /** Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model. */
+ model?: string;
+ /** Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnum;
}
export type PatchedTeamDefaultModifiers = { [key: string]: unknown };
@@ -51117,6 +51132,21 @@ export namespace Schemas {
* @nullable
*/
branch?: string | null;
+ /** Selected runtime adapter ('claude' or 'codex'). Write-only and not persisted on the task: used only to reuse a pre-warmed Run started on the same runtime. A value differing from the warm Run's runtime skips reuse so the task isn't silently run on the wrong runtime.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnum;
+ /** Selected LLM model identifier. Write-only; used only to reuse a warm Run started on the same model. */
+ model?: string;
+ /** Selected reasoning effort. Write-only; used only to reuse a warm Run started on the same effort.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnum;
}
export type TeamDefaultModifiers = { [key: string]: unknown };
@@ -52039,6 +52069,21 @@ export namespace Schemas {
* @nullable
*/
branch?: string | null;
+ /** Agent runtime adapter to warm the sandbox on ('claude' or 'codex'). The warm Run starts the agent on this runtime so a matching submit reuses it; a submit selecting a different runtime falls through to a cold Run instead of reusing a mismatched warm session.
+ *
+ * * `claude` - claude
+ * * `codex` - codex */
+ runtime_adapter?: RuntimeAdapterEnum;
+ /** LLM model identifier to warm the sandbox on. A submit selecting a different model won't reuse this warm Run. */
+ model?: string;
+ /** Reasoning effort to warm the sandbox on for models that expose an effort control.
+ *
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `xhigh` - xhigh
+ * * `max` - max */
+ reasoning_effort?: ReasoningEffortEnum;
}
/**