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.

chore(tasks): remove rolled out cloud run flags (#119960)

Charles Viene837c6a7d427
diff --git a/docs/internal/sandboxes-setup-guide.md b/docs/internal/sandboxes-setup-guide.md
index 04e3a1718a13..b9af669f174e 100644
--- a/docs/internal/sandboxes-setup-guide.md
+++ b/docs/internal/sandboxes-setup-guide.md
@@ -380,7 +380,7 @@ SANDBOX_AGENT_OTEL_LOGS_TOKEN=<project API key of the telemetry project>
SANDBOX_AGENT_OTEL_TRACES_URL=http://localhost:8000/i/v1/traces # optional, enables APM spans
```
-In cloud, emission is additionally gated per run by the `tasks-agent-run-otel-telemetry` feature flag (org-targeted, stamped into run state at dispatch; it also gates the scout run-log mirror). `DEBUG` bypasses the flag, so locally these settings are the only switch. They're injected into the sandbox as `POSTHOG_AGENT_OTEL_LOGS_URL`/`_TOKEN`/`POSTHOG_AGENT_OTEL_TRACES_URL` (deliberately not standard `OTEL_*` names, so OTel SDKs in user code don't auto-export into the telemetry project).
+In cloud, dispatch stamps each run as telemetry-enabled in run state, and the scout run-log mirror only mirrors stamped runs. `DEBUG` skips the stamp, so locally these settings are the only switch. They're injected into the sandbox as `POSTHOG_AGENT_OTEL_LOGS_URL`/`_TOKEN`/`POSTHOG_AGENT_OTEL_TRACES_URL` (deliberately not standard `OTEL_*` names, so OTel SDKs in user code don't auto-export into the telemetry project).
The agent-server exports run/turn/tool lifecycle metadata (never message content or tool arguments), tagged with `run_id`/`task_id`/`team_id`/`user_id`/`distinct_id` resource attributes and `service.name=posthog-code-agent`.
Telemetry stays off when either of the first two vars is unset.
For local Docker sandboxes the localhost URLs are rewritten to `host.docker.internal` automatically; local ingestion requires the `capture-logs` service to be running.
diff --git a/docs/internal/task-pr-review-handover.md b/docs/internal/task-pr-review-handover.md
index 805972176031..b62471d1ae04 100644
--- a/docs/internal/task-pr-review-handover.md
+++ b/docs/internal/task-pr-review-handover.md
@@ -4,7 +4,7 @@ Task PRs open as drafts. The snapshot-based PR monitor can make a draft ready af
## Enable the transition
-Enable `tasks-pr-auto-ready` for selected users or organizations in PostHog. The flag is off by default and is checked before each attempt. The task must also use the PR loop and `tasks-pr-babysit-snapshot`. Its GitHub integration needs permission to write pull requests. The task-management monitor and local runs do not use this transition.
+Enable `tasks-pr-auto-ready` for selected users or organizations in PostHog. The flag is off by default and is checked before each attempt. The task must also use the PR loop. Its GitHub integration needs permission to write pull requests. The task-management monitor and local runs do not use this transition.
To keep a PR in draft, add the `keep-draft` label. Create this label in each repository before you enable the flag. The `no-ci` label also prevents the transition. A task run with `state.keep_draft: true` stays in draft. A PR that someone has already made ready or returned to draft is left alone. An explicit preference to open a report PR ready is independent of this transition and can make the PR ready earlier.
diff --git a/docs/published/handbook/engineering/ai/sandboxed-agents.md b/docs/published/handbook/engineering/ai/sandboxed-agents.md
index 99822d8c91dc..cb0ba28deb88 100644
--- a/docs/published/handbook/engineering/ai/sandboxed-agents.md
+++ b/docs/published/handbook/engineering/ai/sandboxed-agents.md
@@ -549,10 +549,7 @@ When a sandbox was sized by a worker that does not know the preview flag, the pr
Known limit for v1: the dev stack runs with `DEBUG=1`, so a server error renders Django's debug
page inside the preview.
-Restricted runs can use the VM runtime only when `tasks-modal-network-allowlist` is also enabled.
-The network flag interlock runs before state overrides, image-builder routing, custom-image routing,
-and the VM rollout flag. A trusted `use_modal_vm_sandbox` state value cannot bypass it.
-Modal is the authoritative network enforcement layer whenever that flag is enabled, including on VMs.
+Modal is the authoritative network enforcement layer on every restricted Modal run, including on VMs.
AgentSH also applies the compiled policy to the agent-server process tree as defense in depth. The
provider policy applies outside the sandbox, so it covers traffic from the VM and its Docker containers
without relying on AgentSH process tracing.
@@ -626,9 +623,8 @@ task = Task.create_and_run(
The temporal workflow resolves and compiles allowed domains at execution time, so environment updates
take effect on the next run. The compiled policy and its fingerprint stay fixed across activity retries.
-Modal enforces the network boundary on every restricted run when
-`tasks-modal-network-allowlist` is enabled. During the rollout, restricted runs without that flag stay
-on gVisor and use agentsh; they cannot route to a VM without the provider policy.
+Modal enforces the network boundary on every restricted run that provisions on Modal.
+Hogland runs rely on agentsh inside the sandbox.
Environments can also be managed via the REST API (`SandboxEnvironmentViewSet`)
or the PostHog Desktop settings UI.
diff --git a/posthog/settings/temporal.py b/posthog/settings/temporal.py
index 87b9472c2abd..030df511f189 100644
--- a/posthog/settings/temporal.py
+++ b/posthog/settings/temporal.py
@@ -167,15 +167,6 @@ TASKS_USE_MODAL_RESUME_SNAPSHOTS: bool = get_from_env(
type_cast=str_to_bool,
)
-# Force-enables process_task continue_as_new regardless of the tasks-continue-as-new flag
-# (for local E2E / emergency on). The flag is the normal cloud toggle. continue_as_new bounds
-# replay cost so long runs don't trip the 2s workflow-task deadlock detector on eviction.
-TASKS_CONTINUE_AS_NEW_ENABLED: bool = get_from_env(
- "TASKS_CONTINUE_AS_NEW_ENABLED",
- False,
- type_cast=str_to_bool,
-)
-
TASKS_COMPUTE_QUOTA_ENFORCEMENT_ENABLED: bool = get_from_env(
"TASKS_COMPUTE_QUOTA_ENFORCEMENT_ENABLED",
False,
@@ -194,7 +185,7 @@ TASKS_SANDBOX_PERSISTENT_FILESYSTEM_ENABLED: bool = get_from_env(
type_cast=str_to_bool,
)
-# Event-count threshold for the above; 0 relies on Temporal's is_continue_as_new_suggested().
+# process_task continue_as_new history threshold; 0 relies on Temporal's is_continue_as_new_suggested().
TASKS_CONTINUE_AS_NEW_HISTORY_THRESHOLD: int = get_from_env(
"TASKS_CONTINUE_AS_NEW_HISTORY_THRESHOLD", 4000, type_cast=int
)
diff --git a/products/tasks/backend/constants.py b/products/tasks/backend/constants.py
index 24c179322577..0292ce5f6d54 100644
--- a/products/tasks/backend/constants.py
+++ b/products/tasks/backend/constants.py
@@ -38,11 +38,9 @@ EVAL_INTERACTION_ORIGIN = "eval"
MODAL_VM_SANDBOX_FEATURE_FLAG = "tasks-modal-vm-sandbox"
# Gates the nightly prebaked dev-stack image bake (see logic/services/dev_stack_image.py).
DEV_STACK_IMAGE_BAKE_FEATURE_FLAG = "tasks-dev-stack-image-bake"
-MODAL_NETWORK_ALLOWLIST_FEATURE_FLAG = "tasks-modal-network-allowlist"
# Routes a plain default-template run onto the hogland (Firecracker) sandbox backend.
HOGLAND_SANDBOX_FEATURE_FLAG = "tasks-hogland-sandbox"
HOGLAND_HOTPLUG_GOLDEN_FEATURE_FLAG = "tasks-hogland-hotplug-golden"
-AGENT_RUN_OTEL_TELEMETRY_FEATURE_FLAG = "tasks-agent-run-otel-telemetry"
PI_CLOUD_RUNTIME_FEATURE_FLAG = "pi-harness"
REASONING_EFFORTS = model_catalog.REASONING_EFFORTS
# Gates agent-to-agent peer messaging between cloud runs. v1 additionally requires the Pi
@@ -58,8 +56,7 @@ ANALYSIS_TARGET_REPOSITORY_STATE_KEY = "analysis_target_repository"
ANALYSIS_TARGET_IMAGE_ID_STATE_KEY = "analysis_target_custom_image_id"
ANALYSIS_TARGET_IMAGE_NAME_STATE_KEY = "analysis_target_custom_image_name"
TASK_ANALYSIS_ACTIVITIES_STATE_KEY = "task_analysis_activities"
-# Run-state key the telemetry flag decision is stamped under at dispatch (temporal/client.py).
-# Consumers read the stamp, so the decision stays stable for the run's whole lifetime.
+# Dispatch stamps every cloud run, and the run-log mirror skips unstamped runs such as local ones.
AGENT_OTEL_TELEMETRY_STATE_KEY = "agent_otel_telemetry_enabled"
PR_LOOP_ENABLED_STATE_KEY = "pr_loop_enabled"
# TaskRun.state marker for runs completed by the inactivity timeout; kept out of
@@ -228,7 +225,6 @@ TASK_SESSION_UPLOAD_FORM_OVERHEAD_BYTES = 64 * 1024
STREAM_VIA_PROXY_FEATURE_FLAG = "tasks-stream-via-proxy"
OVERLAP_CLONE_BOOT_FEATURE_FLAG = "tasks-overlap-clone-boot"
DESKTOP_WORKSPACE_WARM_FEATURE_FLAG = "task-cloud-desktop-workspace-warm"
-TASK_SIGNALS_CLONING_BLOBLESS_FEATURE_FLAG = "task-signals-cloning-blobless"
# Kill switch: rtk command-output compression is on by default in cloud sandboxes;
# enabling this flag disables it fleet-wide — over any per-run override — without
# an image rebuild.
@@ -240,10 +236,6 @@ CODEX_OWN_SUBSCRIPTION_CLOUD_FEATURE_FLAG = "posthog-code-codex-own-subscription
# refuses, or explains one of these runs takes the name from here.
SUBSCRIPTION_PLAN_NAMES: dict[str, str] = {"claude": "Claude plan", "codex": "ChatGPT plan"}
CODEX_SUBSCRIPTION_EGRESS_DOMAINS: tuple[str, ...] = ("chatgpt.com",)
-# Gates whether long-running process_task runs continue-as-new to bound history/replay cost.
-CONTINUE_AS_NEW_FEATURE_FLAG = "tasks-cloud-run-continue-as-new"
-PR_BABYSIT_SNAPSHOT_FEATURE_FLAG = "tasks-pr-babysit-snapshot"
-SANDBOX_ROTATION_FEATURE_FLAG = "tasks-cloud-run-sandbox-rotation"
SnapshotKind = Literal["filesystem", "directory"]
SNAPSHOT_KIND_FILESYSTEM: SnapshotKind = "filesystem"
diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.py
index 40f655a6b263..41e493959850 100644
--- a/products/tasks/backend/facade/api.py
+++ b/products/tasks/backend/facade/api.py
@@ -2917,7 +2917,6 @@ _PROTECTED_RUN_STATE_KEYS = frozenset(
AGENT_OTEL_TELEMETRY_STATE_KEY,
"sandbox_event_ingest_enabled",
"overlap_clone_boot_enabled",
- "use_modal_network_allowlist",
"stream_presence_gated",
"stream_thin_tail",
PR_LOOP_ENABLED_STATE_KEY,
diff --git a/products/tasks/backend/feature_flags.py b/products/tasks/backend/feature_flags.py
index db3ecc05d96d..6688c95b8528 100644
--- a/products/tasks/backend/feature_flags.py
+++ b/products/tasks/backend/feature_flags.py
@@ -9,7 +9,6 @@ from posthog.utils import get_instance_region
from products.tasks.backend.constants import (
AGENT_OTEL_TELEMETRY_STATE_KEY,
- AGENT_RUN_OTEL_TELEMETRY_FEATURE_FLAG,
DEV_STACK_IMAGE_BAKE_FEATURE_FLAG,
MCP_EXEC_SKILLS_FEATURE_FLAG,
PI_CLOUD_RUNTIME_FEATURE_FLAG,
@@ -25,9 +24,6 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__)
-NATIVE_STEERING_SIGNALS_FEATURE_FLAG = "tasks-native-steering-signals"
-NATIVE_STEERING_SIGNALS_DISTINCT_ID = "tasks-native-steering-signals"
-
DEV_STACK_IMAGE_BAKE_DISTINCT_ID = "tasks-dev-stack-image-bake"
WORKFLOW_DISPATCH_SHADOW_DISTINCT_ID = "tasks-workflow-dispatch-shadow"
@@ -120,42 +116,6 @@ def is_dev_stack_image_bake_enabled() -> bool:
return False
-def is_native_steering_signals_enabled() -> bool:
- if settings.DEBUG:
- return True
-
- try:
- return bool(
- posthoganalytics.feature_enabled(
- NATIVE_STEERING_SIGNALS_FEATURE_FLAG,
- distinct_id=NATIVE_STEERING_SIGNALS_DISTINCT_ID,
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception:
- logger.exception("native_steering_signals_feature_flag_check_failed")
- return False
-
-
-def is_agent_otel_telemetry_enabled(*, distinct_id: str, organization_id: str) -> bool:
- """Org-gated rollout of agent-run OTel telemetry; fail-closed when evaluation fails."""
- try:
- return bool(
- posthoganalytics.feature_enabled(
- AGENT_RUN_OTEL_TELEMETRY_FEATURE_FLAG,
- distinct_id=distinct_id,
- groups={"organization": organization_id},
- group_properties={"organization": {"id": organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception:
- logger.exception("agent_otel_telemetry_flag_check_failed")
- return False
-
-
def pi_cloud_runtime_enabled(team: "Team", user: "User") -> bool:
"""Whether this user may run the Pi harness in the cloud; fail-closed when evaluation fails.
@@ -184,7 +144,7 @@ def get_model_access_error(model: str | None, *, distinct_id: str | None) -> str
Fail-closed on purpose. Only a model the catalog gives an `access_flag` reaches an evaluation at all,
so an evaluation outage withholds a preview model from everyone rather than opening it to
- everyone — the opposite trade to the telemetry flags above, because this one decides spend.
+ everyone, because this flag decides spend.
"""
flag_key = get_required_model_flag(model)
if flag_key is None:
@@ -213,11 +173,7 @@ def get_model_access_error(model: str | None, *, distinct_id: str | None) -> str
def agent_otel_telemetry_enabled_for_state(state: dict | None) -> bool:
- """Per-run telemetry decision, read from the flag value stamped into run state at dispatch.
-
- DEBUG bypasses the flag: the analytics SDK is disabled in local dev, where the
- telemetry env settings / mirror settings are themselves the opt-in.
- """
+ """DEBUG skips the stamp because in local dev the telemetry and mirror settings are the opt-in."""
if settings.DEBUG:
return True
return (state or {}).get(AGENT_OTEL_TELEMETRY_STATE_KEY) is True
diff --git a/products/tasks/backend/metrics.py b/products/tasks/backend/metrics.py
index 2ff13f06ead2..8e586a22ec5f 100644
--- a/products/tasks/backend/metrics.py
+++ b/products/tasks/backend/metrics.py
@@ -140,13 +140,6 @@ SCHEDULED_TASK_RUN_OLDEST_DUE_AGE_SECONDS = Gauge(
"Age of the oldest due scheduled task run",
)
-AGENT_OTEL_TELEMETRY_STAMPED_TOTAL = Counter(
- "posthog_tasks_agent_otel_telemetry_stamped_total",
- "Agent-run OTel telemetry rollout decisions stamped into run state at dispatch "
- "(tasks-agent-run-otel-telemetry flag). First-time stamps only; resumes reuse the stamp.",
- labelnames=["enabled"],
-)
-
RUN_LOG_MIRROR_ENTRIES_TOTAL = Counter(
"posthog_tasks_run_log_mirror_entries_total",
"Task-run log entries mirrored to stdout for the internal Logs project (run_log_mirror).",
diff --git a/products/tasks/backend/models.py b/products/tasks/backend/models.py
index 940f8663f583..78897647e9a7 100644
--- a/products/tasks/backend/models.py
+++ b/products/tasks/backend/models.py
@@ -2839,8 +2839,7 @@ class TaskRun(models.Model):
if not settings.TASK_RUN_LOGS_MIRROR_ORIGIN_PRODUCTS:
return
- # Per-run rollout decision (tasks-agent-run-otel-telemetry), stamped into run
- # state at dispatch; fail closed while the stamp is absent.
+ # Fail closed while the dispatch stamp is absent, so runs that never dispatch stay unmirrored.
if not agent_otel_telemetry_enabled_for_state(self.state if isinstance(self.state, dict) else None):
return
diff --git a/products/tasks/backend/temporal/client.py b/products/tasks/backend/temporal/client.py
index 2b17778487bc..e9e6198d2204 100644
--- a/products/tasks/backend/temporal/client.py
+++ b/products/tasks/backend/temporal/client.py
@@ -19,17 +19,9 @@ from posthog.temporal.common.client import async_connect, sync_connect
from posthog.temporal.common.scoped import scoped_temporal
from posthog.temporal.oauth import PosthogMcpScopes
-from products.tasks.backend.constants import (
- AGENT_OTEL_TELEMETRY_STATE_KEY,
- MODAL_NETWORK_ALLOWLIST_FEATURE_FLAG,
- OVERLAP_CLONE_BOOT_FEATURE_FLAG,
-)
+from products.tasks.backend.constants import AGENT_OTEL_TELEMETRY_STATE_KEY, OVERLAP_CLONE_BOOT_FEATURE_FLAG
from products.tasks.backend.error_telemetry import truncate_error_message
-from products.tasks.backend.feature_flags import (
- agent_otel_telemetry_enabled_for_state,
- is_agent_otel_telemetry_enabled,
- is_native_steering_signals_enabled,
-)
+from products.tasks.backend.feature_flags import agent_otel_telemetry_enabled_for_state
from products.tasks.backend.logic.services.dev_stack_image import DEV_STACK_IMAGE_NAME
from products.tasks.backend.logic.services.dev_stack_image_refresh import reconcile_dev_stack_image
from products.tasks.backend.logic.services.dev_stack_image_state import DevStackImageState
@@ -39,11 +31,7 @@ from products.tasks.backend.logic.stream.redis_stream import (
TASK_RUN_STREAM_INITIAL_GENERATION,
get_task_run_stream_generation,
)
-from products.tasks.backend.metrics import (
- AGENT_OTEL_TELEMETRY_STAMPED_TOTAL,
- observe_task_run_terminal,
- observe_task_run_workflow_start,
-)
+from products.tasks.backend.metrics import observe_task_run_terminal, observe_task_run_workflow_start
from products.tasks.backend.models import TaskRun
from products.tasks.backend.redis import run_uses_dedicated_stream
from products.tasks.backend.temporal.bake_dev_stack_image.workflow import BakeDevStackImageInput
@@ -67,10 +55,7 @@ logger = logging.getLogger(__name__)
_PRE_START_STATUSES: tuple[str, ...] = (TaskRun.Status.NOT_STARTED, TaskRun.Status.QUEUED)
-_BOOT_ROLLOUT_FLAGS: tuple[tuple[str, str], ...] = (
- ("overlap_clone_boot_enabled", OVERLAP_CLONE_BOOT_FEATURE_FLAG),
- ("use_modal_network_allowlist", MODAL_NETWORK_ALLOWLIST_FEATURE_FLAG),
-)
+_BOOT_ROLLOUT_FLAGS: tuple[tuple[str, str], ...] = (("overlap_clone_boot_enabled", OVERLAP_CLONE_BOOT_FEATURE_FLAG),)
def tag_startup_dispatch(task_run: TaskRun | None) -> None:
@@ -215,9 +200,6 @@ def _capture_run_feature_flags(run_id: str) -> dict[str, Any]:
actor_user = get_task_run_credential_user(task, state)
boot_distinct_id = get_actor_distinct_id(actor_user) if actor_user else distinct_id
- otel_telemetry_enabled = need_otel_telemetry and is_agent_otel_telemetry_enabled(
- distinct_id=distinct_id, organization_id=organization_id
- )
boot_flag_values: dict[str, bool] = {
state_key: _evaluate_boot_rollout_flag(
flag_key,
@@ -231,16 +213,12 @@ def _capture_run_feature_flags(run_id: str) -> dict[str, Any]:
def _stamp_flags(latest_state: dict[str, Any]) -> None:
if need_otel_telemetry and not isinstance(latest_state.get(AGENT_OTEL_TELEMETRY_STATE_KEY), bool):
- latest_state[AGENT_OTEL_TELEMETRY_STATE_KEY] = otel_telemetry_enabled
+ latest_state[AGENT_OTEL_TELEMETRY_STATE_KEY] = True
for state_key, value in boot_flag_values.items():
if not isinstance(latest_state.get(state_key), bool):
latest_state[state_key] = value
captured_state = TaskRun.mutate_state_atomic(task_run.id, _stamp_flags)
- if need_otel_telemetry:
- AGENT_OTEL_TELEMETRY_STAMPED_TOTAL.labels(
- enabled=str(bool(captured_state.get(AGENT_OTEL_TELEMETRY_STATE_KEY))).lower()
- ).inc()
logger.info(
"run_feature_flags_captured",
extra={
@@ -659,7 +637,7 @@ def signal_task_followup_message(
async def signal() -> None:
signal_name = "send_followup_message"
- if steer and is_native_steering_signals_enabled():
+ if steer:
try:
protocol_version = await handle.query(
STEERING_PROTOCOL_QUERY,
diff --git a/products/tasks/backend/temporal/process_task/README.md b/products/tasks/backend/temporal/process_task/README.md
index 347f396c657a..bdcf864de4ac 100644
--- a/products/tasks/backend/temporal/process_task/README.md
+++ b/products/tasks/backend/temporal/process_task/README.md
@@ -76,12 +76,10 @@ detector (`[TMPRL1101]`). Two mechanisms bound this:
- The relay coalesces streamed `agent_message_chunk` deltas into one `agent_text_delta` signal
per second (and at turn/tool boundaries), rather than one signal per chunk — see
`TEXT_DELTA_FLUSH_INTERVAL_SECONDS` in `activities/relay_sandbox_events.py`.
-- When enabled, the workflow calls `continue_as_new` from a clean idle point once its history is
+- The workflow calls `continue_as_new` from a clean idle point once its history is
large (Temporal's `is_continue_as_new_suggested()`, or `TASKS_CONTINUE_AS_NEW_HISTORY_THRESHOLD`
- events), re-attaching to the same running sandbox instead of re-provisioning. It's off by
- default and toggled per-org by the `tasks-cloud-run-continue-as-new` feature flag; `TASKS_CONTINUE_AS_NEW_ENABLED`
- force-enables it (local E2E / emergency on). The enable decision is captured at workflow start,
- so in-flight runs and the trigger stay deterministic across replay.
+ events), re-attaching to the same running sandbox instead of re-provisioning. The enable decision
+ is captured at workflow start, so histories recorded with it off keep replaying deterministically.
### Temporal client
diff --git a/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py b/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py
index 2bebaf24657f..45a923c2a8d8 100644
--- a/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py
+++ b/products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py
@@ -23,19 +23,15 @@ from products.tasks.backend.constants import (
CLAUDE_OWN_SUBSCRIPTION_CLOUD_FEATURE_FLAG,
CODEX_OWN_SUBSCRIPTION_CLOUD_FEATURE_FLAG,
CODEX_SUBSCRIPTION_EGRESS_DOMAINS,
- CONTINUE_AS_NEW_FEATURE_FLAG,
DESKTOP_WORKSPACE_WARM_FEATURE_FLAG,
DEV_STACK_IMAGE_NAME,
DEV_STACK_PREVIEW_FEATURE_FLAG,
HOGLAND_HOTPLUG_GOLDEN_FEATURE_FLAG,
HOGLAND_SANDBOX_FEATURE_FLAG,
- MODAL_NETWORK_ALLOWLIST_FEATURE_FLAG,
OVERLAP_CLONE_BOOT_FEATURE_FLAG,
PI_ACP_FEATURE_FLAG,
- PR_BABYSIT_SNAPSHOT_FEATURE_FLAG,
PR_LOOP_ENABLED_STATE_KEY,
RTK_DISABLED_FEATURE_FLAG,
- SANDBOX_ROTATION_FEATURE_FLAG,
STORE_SKILLS_STATE_KEY,
SUBSCRIPTION_PLAN_NAMES,
get_vm_sandbox_flag_payload,
@@ -53,7 +49,6 @@ from products.tasks.backend.exceptions import (
TaskRunNotReadyError,
)
from products.tasks.backend.facade.api import ensure_task_run_session
-from products.tasks.backend.feature_flags import is_agent_otel_telemetry_enabled
from products.tasks.backend.logic.model_access import ModelAccess, resolve_model_access
from products.tasks.backend.logic.services.agent_instructions import agent_instructions_state_update
from products.tasks.backend.logic.services.agentsh import (
@@ -649,40 +644,12 @@ def _is_sandbox_event_ingest_enabled(*, run_id: str, state: dict | None = None)
return True
-@StepTimer("flag_agent_telemetry")
-def _is_agent_otel_telemetry_enabled(
- *,
- distinct_id: str,
- organization_id: str,
- run_id: str,
- state: dict | None = None,
-) -> bool:
- # DEBUG first: local dev disables the analytics SDK, so the dispatch capture always
- # stamps False there - honoring the stamp would disable telemetry locally even with
- # the SANDBOX_AGENT_OTEL_* settings (the local opt-in, which gate emission themselves)
- # set. Matches agent_otel_telemetry_enabled_for_state, which the mirror reads.
- if settings.DEBUG:
- return True
-
- state_override = (state or {}).get(AGENT_OTEL_TELEMETRY_STATE_KEY)
- if isinstance(state_override, bool):
- return state_override
-
- enabled = is_agent_otel_telemetry_enabled(distinct_id=distinct_id, organization_id=organization_id)
- log_with_activity_context(
- "agent_otel_telemetry_flag_checked",
- run_id=run_id,
- agent_otel_telemetry_enabled=enabled,
- )
- return enabled
-
-
@dataclass(frozen=True)
class VmSandboxDecision:
use_vm_sandbox: bool
# Modal image name from the flag payload that VM runs fall back to when no custom
# image was picked. None whenever the payload was not consulted (state override,
- # flag error, network interlock) or defines no default — image-builder runs must
+ # flag error) or defines no default — image-builder runs must
# keep layering on the plain VM base, never on a prebaked default.
default_custom_image: str | None = None
@@ -710,21 +677,9 @@ def _resolve_modal_vm_sandbox(
organization_id: str,
run_id: str,
origin_product: str | None,
- allowed_domains: list[str] | None,
- use_modal_network_allowlist: bool = False,
custom_image_available: bool = False,
state: dict | None = None,
) -> VmSandboxDecision:
- if allowed_domains is not None and not use_modal_network_allowlist:
- # Restricted VMs require Modal's provider policy, so routing cannot consult overrides
- # or rollout flags until that independent policy flag is enabled.
- log_with_activity_context(
- "modal_vm_sandbox_skipped_restricted_egress",
- run_id=run_id,
- use_modal_vm_sandbox=False,
- )
- return VmSandboxDecision(use_vm_sandbox=False)
-
requested_template = (state or {}).get("sandbox_template")
if requested_template not in (None, SandboxTemplate.DEFAULT_BASE.value):
# The VM image carries none of a custom template's tooling, so a rollout that names
@@ -939,46 +894,6 @@ def _is_dev_stack_preview_enabled(
return enabled
-@StepTimer("flag_network_allowlist")
-def _is_modal_network_allowlist_enabled(
- *,
- distinct_id: str,
- organization_id: str,
- run_id: str,
- state: dict | None = None,
-) -> bool:
- state_override = (state or {}).get("use_modal_network_allowlist")
- if isinstance(state_override, bool):
- log_with_activity_context(
- "modal_network_allowlist_state_override",
- run_id=run_id,
- use_modal_network_allowlist=state_override,
- )
- return state_override
-
- try:
- enabled = bool(
- posthoganalytics.feature_enabled(
- MODAL_NETWORK_ALLOWLIST_FEATURE_FLAG,
- distinct_id=distinct_id,
- groups={"organization": organization_id},
- group_properties={"organization": {"id": organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception as e:
- log_with_activity_context("modal_network_allowlist_flag_check_failed", run_id=run_id, error=str(e))
- return False
-
- log_with_activity_context(
- "modal_network_allowlist_flag_checked",
- run_id=run_id,
- use_modal_network_allowlist=enabled,
- )
- return enabled
-
-
@StepTimer("flag_sandbox_backend")
def _resolve_sandbox_backend(
*,
@@ -994,7 +909,7 @@ def _resolve_sandbox_backend(
Hogland only takes plain golden-template ACP runs. A user/environment custom image,
the Pi runtime or a non-default sandbox template are hard incapabilities — hogland
runs only its own golden, so those force Modal even with the flag on. The Modal
- VM-sandbox / network-allowlist flags and the org *default* image are runtime
+ VM-sandbox flag, the Modal network allowlist and the org *default* image are runtime
preferences, not incapabilities: a run the hogland flag (or override) selects wins
hogland over them, and the caller forces them off so the run provisions on hogland's
golden. Egress stays enforced
@@ -1021,8 +936,8 @@ def _resolve_sandbox_backend(
# Hard hogland incapabilities: a user/environment custom image, the Pi runtime or a
# non-default sandbox template cannot run on hogland's golden, so keep those on Modal
# even when the flag is on. The org default image (default_custom_image) is NOT gated
- # here — hogland serves its golden equivalent — nor are the Modal VM-sandbox /
- # network-allowlist flags; a flagged run wins hogland over all of them (the caller
+ # here — hogland serves its golden equivalent — nor are the Modal VM-sandbox flag
+ # and the Modal network allowlist; a flagged run wins hogland over all of them (the caller
# forces them off).
requested_template = (state or {}).get("sandbox_template")
if requested_template not in (None, SandboxTemplate.DEFAULT_BASE.value):
@@ -1069,87 +984,6 @@ def _compile_effective_network_policy(allowed_domains: list[str]) -> EffectiveNe
)
-@StepTimer("flag_pr_babysit")
-def _is_pr_babysit_snapshot_enabled(
- *,
- distinct_id: str,
- organization_id: str,
- run_id: str,
-) -> bool:
- try:
- enabled = bool(
- posthoganalytics.feature_enabled(
- PR_BABYSIT_SNAPSHOT_FEATURE_FLAG,
- distinct_id=distinct_id,
- groups={"organization": organization_id},
- group_properties={"organization": {"id": organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception as e:
- log_with_activity_context("pr_babysit_snapshot_flag_check_failed", run_id=run_id, error=str(e))
- return False
-
- log_with_activity_context("pr_babysit_snapshot_flag_checked", run_id=run_id, pr_babysit_enabled=enabled)
- return enabled
-
-
-def _is_sandbox_rotation_enabled(
- *,
- distinct_id: str,
- organization_id: str,
- run_id: str,
-) -> bool:
- try:
- enabled = bool(
- posthoganalytics.feature_enabled(
- SANDBOX_ROTATION_FEATURE_FLAG,
- distinct_id=distinct_id,
- groups={"organization": organization_id},
- group_properties={"organization": {"id": organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception as e:
- log_with_activity_context("sandbox_rotation_flag_check_failed", run_id=run_id, error=str(e))
- return False
-
- log_with_activity_context("sandbox_rotation_flag_checked", run_id=run_id, sandbox_rotation_enabled=enabled)
- return enabled
-
-
-def _is_continue_as_new_enabled(
- *,
- distinct_id: str,
- organization_id: str,
- run_id: str,
-) -> bool:
- # The env setting force-enables (local E2E / emergency on); otherwise the org-level flag
- # decides, so it can be toggled without a deploy. Captured at workflow start, so the
- # continue_as_new trigger stays deterministic across replay. Fails closed.
- if settings.TASKS_CONTINUE_AS_NEW_ENABLED:
- return True
- try:
- enabled = bool(
- posthoganalytics.feature_enabled(
- CONTINUE_AS_NEW_FEATURE_FLAG,
- distinct_id=distinct_id,
- groups={"organization": organization_id},
- group_properties={"organization": {"id": organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception as e:
- log_with_activity_context("continue_as_new_flag_check_failed", run_id=run_id, error=str(e))
- return False
-
- log_with_activity_context("continue_as_new_flag_checked", run_id=run_id, continue_as_new_enabled=enabled)
- return enabled
-
-
@activity.defn
@asyncify
@close_db_connections
@@ -1371,11 +1205,8 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
"debug",
f"sandbox_event_ingest_enabled: {sandbox_event_ingest_enabled} for this task run",
)
- agent_otel_telemetry_enabled = not trial_origin and _is_agent_otel_telemetry_enabled(
- distinct_id=distinct_id,
- organization_id=organization_id,
- run_id=run_id,
- state=state,
+ agent_otel_telemetry_enabled = not trial_origin and (
+ settings.DEBUG or state.get(AGENT_OTEL_TELEMETRY_STATE_KEY) is not False
)
with StepTimer("flag_context_layer"):
context_layer_enabled = (
@@ -1383,17 +1214,6 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
and not trial_origin
and context_layer_facade.is_context_layer_enabled(organization_id=organization_id, distinct_id=distinct_id)
)
- use_modal_network_allowlist = _is_modal_network_allowlist_enabled(
- distinct_id=distinct_id,
- organization_id=organization_id,
- run_id=run_id,
- state=state,
- )
- emit_agent_log(
- run_id,
- "debug",
- f"use_modal_network_allowlist: {use_modal_network_allowlist} for this task run",
- )
if codex_model_access == "own-subscription" and allowed_domains is not None:
allowed_domains = [
@@ -1413,16 +1233,15 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
sandbox_environment_id=sandbox_environment_id,
invalid_domain_positions=[item.index + 1 for item in error.invalid_domains],
)
- if use_modal_network_allowlist:
- raise SandboxNetworkPolicyError(
- "This sandbox environment contains an invalid allowed domain. Update its network settings and run the task again.",
- {
- "run_id": run_id,
- "sandbox_environment_id": sandbox_environment_id,
- "invalid_domain_positions": [item.index + 1 for item in error.invalid_domains],
- },
- cause=error,
- ) from error
+ raise SandboxNetworkPolicyError(
+ "This sandbox environment contains an invalid allowed domain. Update its network settings and run the task again.",
+ {
+ "run_id": run_id,
+ "sandbox_environment_id": sandbox_environment_id,
+ "invalid_domain_positions": [item.index + 1 for item in error.invalid_domains],
+ },
+ cause=error,
+ ) from error
_require_template_compatible_with_custom_image(state, environment_custom_image_name, run_id=run_id)
vm_sandbox_decision = _resolve_modal_vm_sandbox(
@@ -1430,8 +1249,6 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
organization_id=organization_id,
run_id=run_id,
origin_product=task.origin_product,
- allowed_domains=allowed_domains,
- use_modal_network_allowlist=use_modal_network_allowlist,
custom_image_available=environment_custom_image_name is not None,
state=state,
)
@@ -1518,16 +1335,6 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
):
interactive_max_run_duration_seconds = settings.TASKS_INTERACTIVE_SIGNALS_MAX_RUN_DURATION_SECONDS
- pr_babysit_enabled = pr_loop_enabled and _is_pr_babysit_snapshot_enabled(
- distinct_id=distinct_id,
- organization_id=organization_id,
- run_id=run_id,
- )
- emit_agent_log(
- run_id,
- "debug",
- f"pr_babysit_enabled: {pr_babysit_enabled} for this task run",
- )
sandbox_backend_state = state
resumed_backend = input.resumed_sandbox_backend
if (
@@ -1551,6 +1358,7 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
# serves its golden equivalent — so it must not gate the run onto Modal.
has_user_custom_image=environment_custom_image_name is not None,
)
+ use_modal_network_allowlist = True
if sandbox_backend == "hogland":
# Hogland runs are plain golden-template runs, so the Modal VM-runtime,
# network-allowlist, and org-default-image preferences don't apply. Force them off
@@ -1634,7 +1442,7 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
task_created_by_id=task.created_by_id,
create_pr=input.create_pr,
pr_loop_enabled=pr_loop_enabled,
- pr_babysit_enabled=pr_babysit_enabled,
+ pr_babysit_enabled=pr_loop_enabled,
context_layer_enabled=context_layer_enabled,
state=state,
stream_generation=input.stream_generation
@@ -1657,11 +1465,7 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
use_modal_resume_snapshots=sandbox_backend != "hogland",
use_modal_directory_resume_snapshots=sandbox_backend != "hogland",
sandbox_event_ingest_enabled=sandbox_event_ingest_enabled,
- sandbox_rotation_enabled=_is_sandbox_rotation_enabled(
- distinct_id=distinct_id,
- organization_id=organization_id,
- run_id=run_id,
- ),
+ sandbox_rotation_enabled=True,
agent_otel_telemetry_enabled=agent_otel_telemetry_enabled,
use_modal_vm_sandbox=use_modal_vm_sandbox,
use_modal_network_allowlist=use_modal_network_allowlist,
@@ -1674,11 +1478,7 @@ def get_task_processing_context(input: GetTaskProcessingContextInput) -> TaskPro
benjamin_enabled=benjamin_enabled,
claude_model_access=claude_model_access,
codex_model_access=codex_model_access,
- continue_as_new_enabled=_is_continue_as_new_enabled(
- distinct_id=distinct_id,
- organization_id=organization_id,
- run_id=run_id,
- ),
+ continue_as_new_enabled=True,
continue_as_new_history_threshold=settings.TASKS_CONTINUE_AS_NEW_HISTORY_THRESHOLD,
interactive_max_run_duration_seconds=interactive_max_run_duration_seconds,
sandbox_backend=sandbox_backend,
diff --git a/products/tasks/backend/temporal/process_task/activities/provision_sandbox.py b/products/tasks/backend/temporal/process_task/activities/provision_sandbox.py
index 560d096baa23..fb02a77d7baf 100644
--- a/products/tasks/backend/temporal/process_task/activities/provision_sandbox.py
+++ b/products/tasks/backend/temporal/process_task/activities/provision_sandbox.py
@@ -26,7 +26,6 @@ from products.tasks.backend.constants import (
DEV_STACK_IMAGE_NAME,
SNAPSHOT_KIND_DIRECTORY,
SNAPSHOT_KIND_FILESYSTEM,
- TASK_SIGNALS_CLONING_BLOBLESS_FEATURE_FLAG,
filter_user_sandbox_env_vars,
)
from products.tasks.backend.exceptions import (
@@ -80,11 +79,7 @@ from products.tasks.backend.temporal.metrics import (
sandbox_runtime_label,
)
from products.tasks.backend.temporal.oauth import create_oauth_access_token_for_run, create_wizard_oauth_access_token
-from products.tasks.backend.temporal.observability import (
- emit_agent_log,
- log_activity_execution,
- log_with_activity_context,
-)
+from products.tasks.backend.temporal.observability import emit_agent_log, log_activity_execution
from products.tasks.backend.temporal.process_task.activities.get_pr_context import (
DEFAULT_GITHUB_RATE_LIMIT_BACKOFF_SECONDS,
)
@@ -368,30 +363,6 @@ def _prewarmed_resume_needs_fresh_agent(
return True
-def _is_blobless_signals_clone_enabled(ctx: TaskProcessingContext) -> bool:
- if not needs_full_history(ctx.origin_product):
- return False
-
- try:
- return bool(
- posthoganalytics.feature_enabled(
- TASK_SIGNALS_CLONING_BLOBLESS_FEATURE_FLAG,
- distinct_id=ctx.distinct_id,
- groups={"organization": ctx.organization_id},
- group_properties={"organization": {"id": ctx.organization_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- )
- except Exception as error:
- log_with_activity_context(
- "blobless_signals_clone_flag_check_failed",
- run_id=ctx.run_id,
- error=str(error),
- )
- return False
-
-
def _repository_snapshot_integration_id(ctx: TaskProcessingContext, *, has_repo: bool) -> int | None:
"""The integration to look up a repository-setup snapshot under, or None to clone instead.
@@ -1187,7 +1158,7 @@ async def create_sandbox_for_repository(input: CreateSandboxForRepositoryInput)
@posthoganalytics.scoped(fresh=True, capture_exceptions=False)
def clone_repository_in_sandbox(input: CloneRepositoryInSandboxInput) -> CloneRepositoryInSandboxOutput:
ctx = input.context
- blobless_clone = _is_blobless_signals_clone_enabled(ctx)
+ blobless_clone = needs_full_history(ctx.origin_product)
with log_activity_execution(
"clone_repository_in_sandbox",
diff --git a/products/tasks/backend/temporal/process_task/activities/tests/test_get_task_processing_context.py b/products/tasks/backend/temporal/process_task/activities/tests/test_get_task_processing_context.py
index 12bcb8d66422..f78a6bc8b1ae 100644
--- a/products/tasks/backend/temporal/process_task/activities/tests/test_get_task_processing_context.py
+++ b/products/tasks/backend/temporal/process_task/activities/tests/test_get_task_processing_context.py
@@ -18,12 +18,10 @@ from products.tasks.backend.constants import (
BENJAMIN_FEATURE_FLAG,
CLAUDE_OWN_SUBSCRIPTION_CLOUD_FEATURE_FLAG,
CODEX_OWN_SUBSCRIPTION_CLOUD_FEATURE_FLAG,
- CONTINUE_AS_NEW_FEATURE_FLAG,
DESKTOP_WORKSPACE_WARM_FEATURE_FLAG,
DEV_STACK_IMAGE_NAME,
HOGLAND_SANDBOX_FEATURE_FLAG,
MODAL_VM_SANDBOX_FEATURE_FLAG,
- PR_BABYSIT_SNAPSHOT_FEATURE_FLAG,
RTK_DISABLED_FEATURE_FLAG,
STORE_SKILLS_STATE_KEY,
vm_sandbox_allowed_origin_products,
@@ -41,13 +39,10 @@ from products.tasks.backend.temporal.process_task.activities.get_task_processing
TaskProcessingContext,
VmSandboxDecision,
_ensure_subscription_allowed,
- _is_agent_otel_telemetry_enabled,
_is_benjamin_enabled,
_is_burstable_sandbox_resources_enabled,
- _is_continue_as_new_enabled,
_is_desktop_workspace_warm_enabled,
_is_dev_stack_preview_enabled,
- _is_pr_babysit_snapshot_enabled,
_is_rtk_enabled,
_is_sandbox_event_ingest_enabled,
_require_template_compatible_with_custom_image,
@@ -203,27 +198,6 @@ def test_dev_stack_preview_flag_fails_closed():
assert _preview_gate() is False
-class TestIsAgentOtelTelemetryEnabled:
- @pytest.mark.parametrize(
- "debug,state,expected",
- [
- # DEBUG must win over the stamp: local dev always stamps False (SDK disabled),
- # and the SANDBOX_AGENT_OTEL_* settings are the local opt-in.
- (True, {"agent_otel_telemetry_enabled": False}, True),
- (True, {}, True),
- (False, {"agent_otel_telemetry_enabled": True}, True),
- (False, {"agent_otel_telemetry_enabled": False}, False),
- ],
- )
- def test_debug_wins_then_stamp(self, debug, state, expected):
- with override_settings(DEBUG=debug):
- assert (
- _is_agent_otel_telemetry_enabled(distinct_id="d", organization_id="o", run_id="r", state=state)
- is expected
- )
-
-
class TestGetTaskProcessingContextActivity:
@pytest.mark.django_db(transaction=True)
def test_internal_research_gets_project_and_role_instructions_at_start(
@@ -286,10 +260,6 @@ class TestGetTaskProcessingContextActivity:
"products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
return_value=False,
) as flag,
- patch(
- "products.tasks.backend.temporal.process_task.activities.get_task_processing_context._is_agent_otel_telemetry_enabled",
- return_value=True,
- ),
patch(
"products.tasks.backend.temporal.process_task.activities.get_task_processing_context.context_layer_facade.is_context_layer_enabled",
return_value=True,
@@ -812,56 +782,18 @@ class TestGetTaskProcessingContextActivity:
assert "tasks-pr-loop" not in called_flags
@pytest.mark.django_db(transaction=True)
- @pytest.mark.parametrize(
- "pr_loop_flag, babysit_flag, expected, babysit_flag_consulted",
- [
- (False, True, False, False),
- (True, False, False, True),
- (True, True, True, True),
- ],
- )
- def test_pr_babysit_enabled_requires_both_the_loop_and_its_own_flag(
- self,
- activity_environment,
- test_task,
- pr_loop_flag,
- babysit_flag,
- expected,
- babysit_flag_consulted,
- ):
+ @pytest.mark.parametrize("pr_loop_flag", [False, True])
+ def test_pr_babysit_enabled_follows_the_pr_loop(self, activity_environment, test_task, pr_loop_flag):
task_run = test_task.create_run()
input_data = GetTaskProcessingContextInput(run_id=str(task_run.id))
- def feature_enabled(flag_key, **kwargs):
- if flag_key == "tasks-pr-loop":
- return pr_loop_flag
- if flag_key == PR_BABYSIT_SNAPSHOT_FEATURE_FLAG:
- return babysit_flag
- return False
-
with patch(
"products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
- side_effect=feature_enabled,
- ) as feature_enabled_mock:
+ side_effect=lambda flag_key, **kwargs: pr_loop_flag if flag_key == "tasks-pr-loop" else False,
+ ):
result = async_to_sync(activity_environment.run)(get_task_processing_context, input_data)
- assert result.pr_babysit_enabled is expected
- called_flags = [call.args[0] for call in feature_enabled_mock.call_args_list]
- assert (PR_BABYSIT_SNAPSHOT_FEATURE_FLAG in called_flags) is babysit_flag_consulted
-
- def test_pr_babysit_snapshot_flag_fails_closed(self):
- with patch(
- "products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
- side_effect=RuntimeError("flag service failed"),
- ):
- assert (
- _is_pr_babysit_snapshot_enabled(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- )
- is False
- )
+ assert result.pr_babysit_enabled is pr_loop_flag
@pytest.mark.parametrize(
"state, expected",
@@ -1141,62 +1073,6 @@ class TestGetTaskProcessingContextActivity:
is False
)
- @pytest.mark.parametrize("flag_value, expected", [(True, True), (False, False)])
- @override_settings(TASKS_CONTINUE_AS_NEW_ENABLED=False)
- def test_continue_as_new_flag_uses_organization_rollout(self, flag_value, expected):
- with patch(
- "products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
- return_value=flag_value,
- ) as feature_enabled_mock:
- assert (
- _is_continue_as_new_enabled(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- )
- is expected
- )
-
- feature_enabled_mock.assert_called_once_with(
- CONTINUE_AS_NEW_FEATURE_FLAG,
- distinct_id="distinct-id",
- groups={"organization": "organization-id"},
- group_properties={"organization": {"id": "organization-id"}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
-
- @override_settings(TASKS_CONTINUE_AS_NEW_ENABLED=False)
- def test_continue_as_new_fails_closed_on_flag_error(self):
- with patch(
- "products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
- side_effect=RuntimeError("flag service failed"),
- ):
- assert (
- _is_continue_as_new_enabled(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- )
- is False
- )
-
- @override_settings(TASKS_CONTINUE_AS_NEW_ENABLED=True)
- def test_continue_as_new_env_setting_force_enables_without_flag(self):
- # The force-on env setting must not depend on the flag service.
- with patch(
- "products.tasks.backend.temporal.process_task.activities.get_task_processing_context.posthoganalytics.feature_enabled",
- ) as feature_enabled_mock:
- assert (
- _is_continue_as_new_enabled(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- )
- is True
- )
- feature_enabled_mock.assert_not_called()
-
@pytest.mark.parametrize(
"payload, expected",
[
@@ -1215,7 +1091,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product="user_created",
- allowed_domains=None,
custom_image_available=True,
).use_vm_sandbox
is expected
@@ -1241,7 +1116,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product="user_created",
- allowed_domains=None,
).use_vm_sandbox
is False
)
@@ -1265,7 +1139,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product=origin_product,
- allowed_domains=None,
custom_image_available=custom_image_available,
state={"use_modal_vm_sandbox": True},
).use_vm_sandbox
@@ -1274,111 +1147,6 @@ class TestGetTaskProcessingContextActivity:
payload_mock.assert_not_called()
- def test_modal_vm_sandbox_restricted_egress_forces_gvisor(self):
- with patch(
- VM_FLAG_PAYLOAD_TARGET,
- return_value='{"origin_products": ["user_created"]}',
- ) as payload_mock:
- assert (
- _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="user_created",
- allowed_domains=["github.com"],
- ).use_vm_sandbox
- is False
- )
-
- payload_mock.assert_not_called()
-
- def test_modal_vm_sandbox_restricted_egress_overrides_state_override(self):
- with patch(
- VM_FLAG_PAYLOAD_TARGET,
- return_value='{"origin_products": ["user_created"]}',
- ) as payload_mock:
- assert (
- _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="user_created",
- allowed_domains=["github.com"],
- state={"use_modal_vm_sandbox": True},
- ).use_vm_sandbox
- is False
- )
-
- payload_mock.assert_not_called()
-
- def test_modal_vm_sandbox_restricted_egress_overrides_default_base(self):
- # A restricted run cannot use any VM routing source until the independent network-policy
- # flag is enabled, so the runtime flag is not consulted on this path.
- with patch(
- VM_FLAG_PAYLOAD_TARGET,
- return_value='{"default_base_origin_products": ["user_created"]}',
- ) as payload_mock:
- assert (
- _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="user_created",
- allowed_domains=["github.com"],
- ).use_vm_sandbox
- is False
- )
-
- payload_mock.assert_not_called()
-
- def test_modal_vm_sandbox_restricted_egress_uses_vm_when_provider_policy_is_enabled(self):
- with patch(
- VM_FLAG_PAYLOAD_TARGET,
- return_value='{"origin_products": ["user_created"]}',
- ):
- decision = _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="user_created",
- allowed_domains=["github.com"],
- use_modal_network_allowlist=True,
- custom_image_available=True,
- )
-
- assert decision.use_vm_sandbox is True
-
- def test_modal_vm_sandbox_restricted_state_override_requires_provider_policy(self):
- with patch(VM_FLAG_PAYLOAD_TARGET, return_value=None) as payload_mock:
- decision = _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="image_builder",
- allowed_domains=["github.com"],
- use_modal_network_allowlist=True,
- state={"use_modal_vm_sandbox": True},
- )
-
- assert decision.use_vm_sandbox is True
- payload_mock.assert_not_called()
-
- def test_modal_vm_sandbox_restricted_default_base_requires_provider_policy(self):
- with patch(
- VM_FLAG_PAYLOAD_TARGET,
- return_value='{"default_base_origin_products": ["user_created"]}',
- ):
- decision = _resolve_modal_vm_sandbox(
- distinct_id="distinct-id",
- organization_id="organization-id",
- run_id="run-id",
- origin_product="user_created",
- allowed_domains=["github.com"],
- use_modal_network_allowlist=True,
- )
-
- assert decision.use_vm_sandbox is True
-
def test_modal_vm_sandbox_custom_template_forces_gvisor_over_default_base(self):
# A rollout that names the run's origin cannot move a custom-template run onto the VM
# image, which carries none of the template's tooling; the flag is not consulted.
@@ -1392,7 +1160,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product="autoresearch",
- allowed_domains=None,
state={"sandbox_template": "autoresearch_base"},
).use_vm_sandbox
is False
@@ -1413,7 +1180,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product="user_created",
- allowed_domains=None,
custom_image_available=True,
state={"use_modal_vm_sandbox": False},
).use_vm_sandbox
@@ -1467,7 +1233,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product=origin_product,
- allowed_domains=None,
custom_image_available=custom_image_available,
).use_vm_sandbox
is expected
@@ -1576,7 +1341,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product=origin_product,
- allowed_domains=None,
)
== expected
)
@@ -1593,7 +1357,6 @@ class TestGetTaskProcessingContextActivity:
organization_id="organization-id",
run_id="run-id",
origin_product="image_builder",
- allowed_domains=None,
state={"use_modal_vm_sandbox": True},
)
diff --git a/products/tasks/backend/temporal/process_task/tests/test_provision_sandbox.py b/products/tasks/backend/temporal/process_task/tests/test_provision_sandbox.py
index 848725898ad3..00fe555017b5 100644
--- a/products/tasks/backend/temporal/process_task/tests/test_provision_sandbox.py
+++ b/products/tasks/backend/temporal/process_task/tests/test_provision_sandbox.py
@@ -6,15 +6,8 @@ from unittest.mock import MagicMock, patch
from django.test import override_settings
-from products.tasks.backend.constants import TASK_SIGNALS_CLONING_BLOBLESS_FEATURE_FLAG
from products.tasks.backend.exceptions import SandboxNetworkPolicyError, TaskInvalidStateError
-from products.tasks.backend.logic.services.sandbox import (
- ExecutionResult,
- SandboxConfig,
- SandboxTemplate,
- needs_full_history,
-)
-from products.tasks.backend.models import Task
+from products.tasks.backend.logic.services.sandbox import ExecutionResult, SandboxConfig, SandboxTemplate
from products.tasks.backend.temporal.process_task.activities.get_task_processing_context import TaskProcessingContext
from products.tasks.backend.temporal.process_task.activities.provision_sandbox import (
CheckoutBranchInSandboxInput,
@@ -24,7 +17,6 @@ from products.tasks.backend.temporal.process_task.activities.provision_sandbox i
_build_environment_variables,
_build_sandbox_tags,
_effective_sandbox_template,
- _is_blobless_signals_clone_enabled,
_requested_sandbox_template,
_to_modal_domain_allowlist,
checkout_branch_in_sandbox,
@@ -145,41 +137,6 @@ def test_build_sandbox_tags_drops_none_values():
assert all(isinstance(value, str) for value in tags.values())
- ("origin_product", "flag_result", "expected"),
- [
- (Task.OriginProduct.SIGNAL_REPORT, True, True),
- (Task.OriginProduct.SIGNAL_REPORT, False, False),
- (Task.OriginProduct.SIGNALS_SCOUT, True, True),
- (Task.OriginProduct.SIGNALS_SCOUT, False, False),
- (Task.OriginProduct.ERROR_TRACKING, True, False),
- (Task.OriginProduct.USER_CREATED, True, False),
- ],
-)
-def test_blobless_clone_only_applies_to_enabled_signal_tasks(mocker, origin_product, flag_result, expected):
- feature_enabled = mocker.patch(f"{_PROVISION}.posthoganalytics.feature_enabled", return_value=flag_result)
-
- assert _is_blobless_signals_clone_enabled(_context(origin_product=origin_product)) is expected
-
- if needs_full_history(origin_product):
- feature_enabled.assert_called_once_with(
- TASK_SIGNALS_CLONING_BLOBLESS_FEATURE_FLAG,
- distinct_id="distinct-id",
- groups={"organization": "org-uuid"},
- group_properties={"organization": {"id": "org-uuid"}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- else:
- feature_enabled.assert_not_called()
-
-
-def test_blobless_clone_fails_closed_when_flag_evaluation_fails(mocker):
- mocker.patch(f"{_PROVISION}.posthoganalytics.feature_enabled", side_effect=RuntimeError("unavailable"))
-
- assert _is_blobless_signals_clone_enabled(_context(origin_product=Task.OriginProduct.SIGNAL_REPORT)) is False
-
-
# All four SANDBOX_*_URL settings are pinned: they feed the enforced allowlist
# outside DEBUG, so a developer's environment value (an ngrok SANDBOX_API_URL)
# would otherwise leak into these exact-equality expectations.
diff --git a/products/tasks/backend/temporal/task_management/activities/ensure_execute_sandbox_started.py b/products/tasks/backend/temporal/task_management/activities/ensure_execute_sandbox_started.py
index bf2891398f2d..c7fb11a1639b 100644
--- a/products/tasks/backend/temporal/task_management/activities/ensure_execute_sandbox_started.py
+++ b/products/tasks/backend/temporal/task_management/activities/ensure_execute_sandbox_started.py
@@ -15,13 +15,11 @@ from dataclasses import dataclass
from django.conf import settings
-from asgiref.sync import sync_to_async
from temporalio import activity
from temporalio.common import WorkflowIDReusePolicy
from posthog.temporal.common.client import async_connect
-from products.tasks.backend.feature_flags import is_native_steering_signals_enabled
from products.tasks.backend.temporal.constants import STEERING_PROTOCOL_QUERY, STEERING_PROTOCOL_QUERY_TIMEOUT
from products.tasks.backend.temporal.execute_sandbox.workflow import PARENT_ATTACHED_SIGNAL, ExecuteSandboxInput
from products.tasks.backend.temporal.observability import log_activity_execution
@@ -62,11 +60,6 @@ async def ensure_execute_sandbox_started(input: EnsureExecuteSandboxStartedInput
# restart. Recovery from those failures lives at the orchestrator
# level via the ACK-retry / re-bootstrap path.
)
- native_steering_signals_enabled = await sync_to_async(
- is_native_steering_signals_enabled, thread_sensitive=False
- )()
- if not native_steering_signals_enabled:
- return 0
try:
protocol_version = await handle.query(
STEERING_PROTOCOL_QUERY,
diff --git a/products/tasks/backend/temporal/task_management/activities/tests/test_ensure_execute_sandbox_started.py b/products/tasks/backend/temporal/task_management/activities/tests/test_ensure_execute_sandbox_started.py
index f1c467c63afd..b4fda3e30f18 100644
--- a/products/tasks/backend/temporal/task_management/activities/tests/test_ensure_execute_sandbox_started.py
+++ b/products/tasks/backend/temporal/task_management/activities/tests/test_ensure_execute_sandbox_started.py
@@ -1,5 +1,5 @@
import pytest
-from unittest.mock import AsyncMock, Mock, patch
+from unittest.mock import AsyncMock, patch
from django.conf import settings
@@ -44,10 +44,6 @@ class TestEnsureExecuteSandboxStarted:
)
with (
- patch(
- "products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.is_native_steering_signals_enabled",
- Mock(return_value=True),
- ),
patch(
"products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.async_connect",
AsyncMock(return_value=client),
@@ -88,10 +84,6 @@ class TestEnsureExecuteSandboxStarted:
)
with (
- patch(
- "products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.is_native_steering_signals_enabled",
- Mock(return_value=True),
- ),
patch(
"products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.async_connect",
AsyncMock(return_value=client),
@@ -104,28 +96,3 @@ class TestEnsureExecuteSandboxStarted:
STEERING_PROTOCOL_QUERY,
rpc_timeout=STEERING_PROTOCOL_QUERY_TIMEOUT,
)
-
- async def test_disabled_feature_flag_skips_capability_query(self, activity_environment):
- client = AsyncMock()
- handle = AsyncMock()
- client.start_workflow.return_value = handle
- input_data = EnsureExecuteSandboxStartedInput(
- workflow_id="sandbox-wf-id",
- workflow_input=ExecuteSandboxInput(run_id="run-1", parent_workflow_id="parent-wf-id"),
- bootstrap_ack_id="ack-bootstrap",
- )
-
- with (
- patch(
- "products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.is_native_steering_signals_enabled",
- Mock(return_value=False),
- ),
- patch(
- "products.tasks.backend.temporal.task_management.activities.ensure_execute_sandbox_started.async_connect",
- AsyncMock(return_value=client),
- ),
- ):
- protocol_version = await activity_environment.run(ensure_execute_sandbox_started, input_data)
-
- assert protocol_version == 0
- handle.query.assert_not_awaited()
diff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.py
index 6d91b1f7a652..b93e93cd15fc 100644
--- a/products/tasks/backend/tests/test_api.py
+++ b/products/tasks/backend/tests/test_api.py
@@ -7669,7 +7669,6 @@ class TestTaskRunAPI(BaseTaskAPITest):
"agent_otel_telemetry_enabled": False,
"sandbox_event_ingest_enabled": False,
"overlap_clone_boot_enabled": False,
- "use_modal_network_allowlist": True,
"stream_presence_gated": True,
"stream_thin_tail": True,
"snapshot_external_id": "im-real",
@@ -7751,7 +7750,6 @@ class TestTaskRunAPI(BaseTaskAPITest):
"agent_otel_telemetry_enabled": True,
"sandbox_event_ingest_enabled": True,
"overlap_clone_boot_enabled": True,
- "use_modal_network_allowlist": False,
"stream_presence_gated": False,
"stream_thin_tail": False,
"snapshot_external_id": "im-attacker",
@@ -7834,7 +7832,6 @@ class TestTaskRunAPI(BaseTaskAPITest):
assert run.state["agent_otel_telemetry_enabled"] is False
assert run.state["sandbox_event_ingest_enabled"] is False
assert run.state["overlap_clone_boot_enabled"] is False
- assert run.state["use_modal_network_allowlist"] is True
assert run.state["stream_presence_gated"] is True
assert run.state["stream_thin_tail"] is True
assert run.state["snapshot_external_id"] == "im-real"
@@ -7903,7 +7900,6 @@ class TestTaskRunAPI(BaseTaskAPITest):
"loop_id",
"agent_otel_telemetry_enabled",
"overlap_clone_boot_enabled",
- "use_modal_network_allowlist",
"stream_presence_gated",
"stream_thin_tail",
"sandbox_id",
@@ -7956,7 +7952,6 @@ class TestTaskRunAPI(BaseTaskAPITest):
assert run.state["include_live_context"] is False
assert run.state["agent_otel_telemetry_enabled"] is False # protected key survives removal
assert run.state["overlap_clone_boot_enabled"] is False
- assert run.state["use_modal_network_allowlist"] is True
assert run.state["stream_presence_gated"] is True # protected key survives removal
assert run.state["stream_thin_tail"] is True # protected key survives removal
assert run.state["sandbox_id"] == "sb-real" # protected key survives removal
diff --git a/products/tasks/backend/tests/test_temporal_client.py b/products/tasks/backend/tests/test_temporal_client.py
index 47eea2dbe194..574b3691b4cb 100644
--- a/products/tasks/backend/tests/test_temporal_client.py
+++ b/products/tasks/backend/tests/test_temporal_client.py
@@ -11,6 +11,7 @@ from temporalio.exceptions import WorkflowAlreadyStartedError
from posthog.models import Organization, Team
from posthog.models.user import User
+from products.tasks.backend.constants import AGENT_OTEL_TELEMETRY_STATE_KEY
from products.tasks.backend.logic.stream.redis_stream import get_task_run_stream_generation, reset_task_run_stream
from products.tasks.backend.models import Task, TaskRun
from products.tasks.backend.temporal.client import (
@@ -28,61 +29,20 @@ from products.tasks.backend.temporal.constants import (
from products.tasks.backend.temporal.run_trace import run_trace_context
-@override_settings(DEBUG=False)
class TestSignalTaskFollowupMessage(SimpleTestCase):
@parameterized.expand(
[
- (
- False,
- True,
- None,
- "send_followup_message",
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
- (
- True,
- False,
- 1,
- "send_followup_message",
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
- (
- True,
- True,
- 1,
- SEND_STEER_SIGNAL,
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
- (
- True,
- True,
- RuntimeError("query not registered"),
- "send_followup_message",
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
- (
- True,
- True,
- TimeoutError("query timed out"),
- "send_followup_message",
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
- (
- True,
- RuntimeError("feature flag unavailable"),
- 1,
- "send_followup_message",
- ["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}],
- ),
+ (False, None, "send_followup_message"),
+ (True, 1, SEND_STEER_SIGNAL),
+ (True, RuntimeError("query not registered"), "send_followup_message"),
+ (True, TimeoutError("query timed out"), "send_followup_message"),
]
)
def test_capability_gates_versioned_signal_and_preserves_sender_fields(
self,
steer: bool,
- feature_flag_result: bool | Exception,
query_result: int | Exception | None,
expected_signal: str,
- expected_args: list[object],
) -> None:
handle = Mock()
handle.signal = AsyncMock()
@@ -94,14 +54,7 @@ class TestSignalTaskFollowupMessage(SimpleTestCase):
client = Mock()
client.get_workflow_handle.return_value = handle
- with (
- patch("products.tasks.backend.feature_flags.posthoganalytics.feature_enabled") as feature_enabled,
- patch("products.tasks.backend.temporal.client.sync_connect", return_value=client),
- ):
- if isinstance(feature_flag_result, Exception):
- feature_enabled.side_effect = feature_flag_result
- else:
- feature_enabled.return_value = feature_flag_result
+ with patch("products.tasks.backend.temporal.client.sync_connect", return_value=client):
signal_task_followup_message(
"workflow-id",
"hello",
@@ -112,8 +65,10 @@ class TestSignalTaskFollowupMessage(SimpleTestCase):
steer=steer,
)
- handle.signal.assert_awaited_once_with(expected_signal, args=expected_args)
- if steer and feature_flag_result is True:
+ handle.signal.assert_awaited_once_with(
+ expected_signal, args=["hello", ["artifact-1"], "message-1", 42, {"actor_slack_user_id": "U1"}]
+ )
+ if steer:
handle.query.assert_awaited_once_with(
STEERING_PROTOCOL_QUERY,
rpc_timeout=STEERING_PROTOCOL_QUERY_TIMEOUT,
@@ -249,24 +204,14 @@ class TestExecuteTaskProcessingWorkflow(TestCase):
run.refresh_from_db()
self.assertEqual(run.state["agent_otel_telemetry_enabled"], True)
self.assertEqual(run.state["overlap_clone_boot_enabled"], True)
- self.assertEqual(run.state["use_modal_network_allowlist"], True)
- # Patching the shared posthoganalytics module attribute covers every evaluation
- # site (client.py for the rollout stamps, feature_flags.py for telemetry).
- self.assertEqual(flag.call_count, 3)
- actor_distinct_id = f"user_{self.user.id}"
- for flag_key, expected_distinct_id in (
- ("tasks-agent-run-otel-telemetry", "process_task_workflow"),
- ("tasks-overlap-clone-boot", actor_distinct_id),
- ("tasks-modal-network-allowlist", actor_distinct_id),
- ):
- flag.assert_any_call(
- flag_key,
- distinct_id=expected_distinct_id,
- groups={"organization": str(self.organization.id)},
- group_properties={"organization": {"id": str(self.organization.id)}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
+ flag.assert_called_once_with(
+ "tasks-overlap-clone-boot",
+ distinct_id=f"user_{self.user.id}",
+ groups={"organization": str(self.organization.id)},
+ group_properties={"organization": {"id": str(self.organization.id)}},
+ only_evaluate_locally=False,
+ send_feature_flag_events=False,
+ )
@parameterized.expand(
[
@@ -280,6 +225,8 @@ class TestExecuteTaskProcessingWorkflow(TestCase):
self, _name: str, executor: str, telemetry_enabled: bool
) -> None:
run = self._create_run()
+ if not telemetry_enabled:
+ TaskRun.update_state_atomic(str(run.id), updates={AGENT_OTEL_TELEMETRY_STATE_KEY: False})
propagated: dict[str, str] = {}
async def record_propagated_context(*args: object, **kwargs: object) -> None:
@@ -297,10 +244,7 @@ class TestExecuteTaskProcessingWorkflow(TestCase):
with (
patch(connect_target, connect_mock),
- patch(
- "products.tasks.backend.temporal.client.posthoganalytics.feature_enabled",
- return_value=telemetry_enabled,
- ),
+ patch("products.tasks.backend.temporal.client.posthoganalytics.feature_enabled", return_value=False),
):
self._execute_workflow(executor, run, self.user.id)
@@ -310,7 +254,7 @@ class TestExecuteTaskProcessingWorkflow(TestCase):
def test_boot_flag_capture_keeps_existing_stamp_and_survives_one_flag_error(self) -> None:
run = self._create_run()
- TaskRun.update_state_atomic(str(run.id), updates={"use_modal_network_allowlist": False})
+ TaskRun.update_state_atomic(str(run.id), updates={AGENT_OTEL_TELEMETRY_STATE_KEY: False})
client = Mock()
client.start_workflow = AsyncMock()
@@ -331,8 +275,7 @@ class TestExecuteTaskProcessingWorkflow(TestCase):
client.start_workflow.assert_awaited_once()
run.refresh_from_db()
self.assertEqual(run.state["overlap_clone_boot_enabled"], False)
- self.assertEqual(run.state["use_modal_network_allowlist"], False)
- self.assertEqual(run.state["agent_otel_telemetry_enabled"], True)
+ self.assertEqual(run.state["agent_otel_telemetry_enabled"], False)
@override_settings(TASK_RUN_STREAM_GENERATION_ROTATION_ENABLED=True)
def test_captures_run_feature_flags_before_resuming_workflow(self) -> None: