: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(tasks): support auto_publish option on cloud task runs (#68864)
Peter Kirkhamc71023268ec9
diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.pyindex 91df1e4e63b6..3e7ac89716aa 100644--- a/products/tasks/backend/facade/api.py+++ b/products/tasks/backend/facade/api.py@@ -2256,6 +2256,7 @@ def bootstrap_task_run(branch = validated_data.get("branch")sandbox_environment_id = validated_data.get("sandbox_environment_id")pr_authorship_mode = validated_data.get("pr_authorship_mode")+ auto_publish = validated_data.get("auto_publish")run_source = validated_data.get("run_source")signal_report_id = validated_data.get("signal_report_id")runtime_adapter = validated_data.get("runtime_adapter")@@ -2275,6 +2276,7 @@ def bootstrap_task_run(for key, value in {"pr_base_branch": branch,"pr_authorship_mode": pr_authorship_mode,+ "auto_publish": auto_publish,"run_source": run_source,"signal_report_id": signal_report_id,"runtime_adapter": runtime_adapter,@@ -2867,6 +2869,7 @@ def create_task(team_id: int, user_id: int | None, *, validated_data: dict) -> cwarm_reasoning_effort = validated_data.pop("reasoning_effort", None)pending_user_message = (validated_data.pop("pending_user_message", None) or "").strip() or Nonepending_user_artifact_ids = validated_data.pop("pending_user_artifact_ids", None) or []+ warm_auto_publish = validated_data.pop("auto_publish", None)if user_id is not None:validated_data["created_by"] = User.objects.get(id=user_id)@@ -2923,6 +2926,7 @@ def create_task(team_id: int, user_id: int | None, *, validated_data: dict) -> cmessage=pending_user_message or description or None,description=description or None,artifact_ids=pending_user_artifact_ids,+ auto_publish=warm_auto_publish,)return _task_detail_to_dto(_task_detail_queryset().get(pk=warm_task.pk))@@ -3252,11 +3256,16 @@ def _activate_warm_run(message: str | None,artifact_ids: list[str],description: str | None = None,+ auto_publish: bool | None = None,) -> None:"""Activate an idling warm Run: set the draft Task's visible description from raw task text,forward the first message to the already-running agent, and drop the ``await_user_message`` markerso the Run leaves the warm pool. Mirrors ``message_routing._handle_first_message``; no fresh agent- start."""+ start.++ ``auto_publish`` is persisted into the Run's state before the message signal: the already-running+ agent-server can't take it as a launch flag, so it re-reads run state when the forwarded first+ message arrives (and resumes read it from carried state)."""from products.tasks.backend.metrics import ( # noqa: PLC0415 — keep prometheus deps off the api import pathobserve_prewarmed_activated,)@@ -3264,6 +3273,10 @@ def _activate_warm_run(if description and not (task.description or "").strip():task.description = descriptiontask.save(update_fields=["description", "updated_at"])+ if auto_publish is not None:+ # Before the signal: the agent-server re-reads run state when the forwarded+ # first message arrives, so the choice must already be persisted by then.+ TaskRun.update_state_atomic(run.id, updates={"auto_publish": auto_publish})signal_task_run_user_message(run.id, task.id, team_id, content=message, artifact_ids=artifact_ids)TaskRun.update_state_atomic(run.id, remove_keys=["await_user_message"])# Only count activations of Runs that actually carry the prewarmed marker, so the activation@@ -3439,11 +3452,13 @@ def run_task(message=pending_user_message or (task.description or None),description=task.description or None,artifact_ids=pending_user_artifact_ids,+ auto_publish=validated_data.get("auto_publish"),)return contracts.TaskRunResult(task=get_task_detail(task.id, team_id, user_id))sandbox_environment_id = validated_data.get("sandbox_environment_id")sandbox_environment_id_supplied_by_user = sandbox_environment_id is not Nonepr_authorship_mode = validated_data.get("pr_authorship_mode")+ auto_publish = validated_data.get("auto_publish")run_source = validated_data.get("run_source")signal_report_id = validated_data.get("signal_report_id")runtime_adapter = validated_data.get("runtime_adapter")@@ -3456,6 +3471,7 @@ def run_task(runtime_state_fields = {"pr_authorship_mode": pr_authorship_mode,+ "auto_publish": auto_publish,"run_source": run_source,"signal_report_id": signal_report_id,"runtime_adapter": runtime_adapter,@@ -3493,6 +3509,7 @@ def run_task(runtime_state_fields[field_name] = getattr(prev_state, field_name)pr_authorship_mode = runtime_state_fields["pr_authorship_mode"]+ auto_publish = runtime_state_fields["auto_publish"]run_source = runtime_state_fields["run_source"]signal_report_id = runtime_state_fields["signal_report_id"]runtime_adapter = runtime_state_fields["runtime_adapter"]@@ -3506,6 +3523,7 @@ def run_task(for key, value in {"pr_base_branch": branch,"pr_authorship_mode": pr_authorship_mode,+ "auto_publish": auto_publish,"run_source": run_source,"signal_report_id": signal_report_id,"runtime_adapter": runtime_adapter,diff --git a/products/tasks/backend/logic/services/docker_sandbox.py b/products/tasks/backend/logic/services/docker_sandbox.pyindex 4987c2d0d5c7..82e5f0860e3d 100644--- a/products/tasks/backend/logic/services/docker_sandbox.py+++ b/products/tasks/backend/logic/services/docker_sandbox.py@@ -746,6 +746,7 @@ class DockerSandbox(SandboxBase):run_id: str,mode: str,create_pr: bool,+ auto_publish: bool = False,interaction_origin: str | None = None,branch: str | None = None,runtime_adapter: str | None = None,@@ -774,6 +775,9 @@ class DockerSandbox(SandboxBase):event_ingest_keep_stream_open=event_ingest_keep_stream_open,)create_pr_flag = f" --createPr {shlex.quote('true' if create_pr else 'false')}"+ # Only append when opted in: agent-server builds without the option reject unknown+ # flags, so default runs (and resumes of old snapshots) must not see it.+ auto_publish_flag = " --autoPublish true" if auto_publish else ""branch_flag = f" --baseBranch {shlex.quote(branch)}" if branch else ""repo_flag = f" --repositoryPath {shlex.quote(repo_path)}" if repo_path else ""domains_flag = f" --allowedDomains {shlex.quote(','.join(allowed_domains))}" if allowed_domains else ""@@ -787,7 +791,7 @@ class DockerSandbox(SandboxBase):f"env {unset_flags}BASH_ENV={shlex.quote(BASH_ENV_SCRIPT)} "f"{env_prefix}./node_modules/.bin/agent-server --port {AGENT_SERVER_PORT}{repo_flag} "f"--taskId {shlex.quote(task_id)} --runId {shlex.quote(run_id)} --mode {shlex.quote(mode)}"- f"{create_pr_flag}{branch_flag}{mcp_servers_arg}{domains_flag}{repo_ready_flag}"+ f"{create_pr_flag}{auto_publish_flag}{branch_flag}{mcp_servers_arg}{domains_flag}{repo_ready_flag}")# agentsh injects HTTP_PROXY pointing at a per-session egress proxy port; undici@@ -827,6 +831,7 @@ class DockerSandbox(SandboxBase):run_id: str,mode: str = "background",create_pr: bool = True,+ auto_publish: bool = False,interaction_origin: str | None = None,branch: str | None = None,runtime_adapter: str | None = None,@@ -871,12 +876,17 @@ class DockerSandbox(SandboxBase):mcp_json = json.dumps([c.to_dict() for c in mcp_configs])mcp_servers_arg = f" --mcpServers {shlex.quote(mcp_json)}"+ if auto_publish and not self.agent_server_supports_auto_publish():+ logger.warning(f"Installed agent-server in sandbox {self.id} predates --autoPublish; starting review-first")+ auto_publish = False+command = self._build_agent_server_command(repo_path,task_id,run_id,mode,create_pr,+ auto_publish,interaction_origin,branch,runtime_adapter,@@ -923,6 +933,7 @@ class DockerSandbox(SandboxBase):run_id,mode,create_pr,+ auto_publish,interaction_origin,branch=None,runtime_adapter=runtime_adapter,diff --git a/products/tasks/backend/logic/services/modal_sandbox.py b/products/tasks/backend/logic/services/modal_sandbox.pyindex fe535852c9a0..017d9aca01b0 100644--- a/products/tasks/backend/logic/services/modal_sandbox.py+++ b/products/tasks/backend/logic/services/modal_sandbox.py@@ -797,6 +797,7 @@ class ModalSandbox(SandboxBase):run_id: str,mode: str,create_pr: bool,+ auto_publish: bool = False,interaction_origin: str | None = None,branch: str | None = None,runtime_adapter: str | None = None,@@ -821,6 +822,9 @@ class ModalSandbox(SandboxBase):event_ingest_keep_stream_open=event_ingest_keep_stream_open,)create_pr_flag = f" --createPr {shlex.quote('true' if create_pr else 'false')}"+ # Only append when opted in: agent-server builds without the option reject unknown+ # flags, so default runs (and resumes of old snapshots) must not see it.+ auto_publish_flag = " --autoPublish true" if auto_publish else ""repo_flag = f" --repositoryPath {shlex.quote(repo_path)}" if repo_path else ""branch_flag = f" --baseBranch {shlex.quote(branch)}" if branch else ""domains_flag = f" --allowedDomains {shlex.quote(','.join(allowed_domains))}" if allowed_domains else ""@@ -834,7 +838,7 @@ class ModalSandbox(SandboxBase):f"env {unset_flags}BASH_ENV={shlex.quote(BASH_ENV_SCRIPT)} "f"{env_prefix}./node_modules/.bin/agent-server --port {AGENT_SERVER_PORT}{repo_flag} "f"--taskId {shlex.quote(task_id)} --runId {shlex.quote(run_id)} --mode {shlex.quote(mode)}"- f"{create_pr_flag}{branch_flag}{mcp_servers_arg}{domains_flag}{repo_ready_flag}"+ f"{create_pr_flag}{auto_publish_flag}{branch_flag}{mcp_servers_arg}{domains_flag}{repo_ready_flag}")inner = f"cd /scripts && {server_cmd} > /tmp/agent-server.log 2>&1"@@ -901,6 +905,7 @@ class ModalSandbox(SandboxBase):run_id: str,mode: str = "background",create_pr: bool = True,+ auto_publish: bool = False,interaction_origin: str | None = None,branch: str | None = None,runtime_adapter: str | None = None,@@ -944,12 +949,17 @@ class ModalSandbox(SandboxBase):mcp_json = json.dumps([c.to_dict() for c in mcp_configs])mcp_servers_arg = f" --mcpServers {shlex.quote(mcp_json)}"+ if auto_publish and not self.agent_server_supports_auto_publish():+ logger.warning(f"Installed agent-server in sandbox {self.id} predates --autoPublish; starting review-first")+ auto_publish = False+command = self._build_agent_server_command(repo_path,task_id,run_id,mode,create_pr,+ auto_publish,interaction_origin,branch,runtime_adapter,diff --git a/products/tasks/backend/logic/services/sandbox.py b/products/tasks/backend/logic/services/sandbox.pyindex 7bb94725b1ef..7412f48adf1d 100644--- a/products/tasks/backend/logic/services/sandbox.py+++ b/products/tasks/backend/logic/services/sandbox.py@@ -204,6 +204,13 @@ class SandboxBase(ABC):@abstractmethoddef write_file(self, path: str, payload: bytes) -> ExecutionResult: ...+ def agent_server_supports_auto_publish(self) -> bool:+ """Sandboxes restored from old snapshots can carry an agent-server that rejects unknown+ CLI options, so probe the installed binary before passing --autoPublish; unsupported+ binaries degrade to review-first instead of crashing at launch."""+ result = self.execute("grep -q autoPublish /scripts/node_modules/.bin/agent-server", timeout_seconds=10)+ return result.exit_code == 0+def clone_repository(self, repository: str, github_token: str | None = "", shallow: bool = True) -> ExecutionResult:if not self.is_running():raise RuntimeError("Sandbox not in running state.")@@ -263,6 +270,7 @@ class SandboxBase(ABC):run_id: str,mode: str = "background",create_pr: bool = True,+ auto_publish: bool = False,interaction_origin: str | None = None,branch: str | None = None,runtime_adapter: str | None = None,diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.pyindex 3389244bb572..168a1e4f3317 100644--- a/products/tasks/backend/presentation/serializers.py+++ b/products/tasks/backend/presentation/serializers.py@@ -492,6 +492,19 @@ class TaskWriteSerializer(serializers.Serializer):"created cold. Ignored when no warm Run is matched."),)+ auto_publish = serializers.BooleanField(+ required=False,+ allow_null=True,+ default=None,+ write_only=True,+ help_text=(+ "When true, the cloud run agent pushes its work and opens a draft pull request on "+ "completion without waiting for an explicit ask. Write-only and not persisted on the "+ "task: persisted into the reused warm Run's state when creation activates one, so "+ "resumes of that Run honor it. Ignored when no warm Run is reused — cold creation "+ "takes it via the run start endpoint instead."+ ),+ )channel = TeamScopedPrimaryKeyRelatedField( # nosemgrep: unscoped-primary-key-related-fieldqueryset=Integration.objects.none(),required=False,@@ -1231,6 +1244,15 @@ class TaskRunCreateRequestSerializer(serializers.Serializer):default=None,help_text="Whether pull requests for this run should be authored by the user or the bot.",)+ auto_publish = serializers.BooleanField(+ required=False,+ allow_null=True,+ default=None,+ help_text=(+ "When true, the cloud run agent pushes its work and opens a draft pull request on "+ "completion without waiting for an explicit ask."+ ),+ )run_source = serializers.ChoiceField(choices=RUN_SOURCE_CHOICES,required=False,@@ -1383,6 +1405,15 @@ class TaskRunBootstrapCreateRequestSerializer(serializers.Serializer):default=None,help_text="Whether pull requests for this run should be authored by the user or the bot.",)+ auto_publish = serializers.BooleanField(+ required=False,+ allow_null=True,+ default=None,+ help_text=(+ "When true, the cloud run agent pushes its work and opens a draft pull request on "+ "completion without waiting for an explicit ask."+ ),+ )run_source = serializers.ChoiceField(choices=RUN_SOURCE_CHOICES,required=False,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.pyindex e0dc1c21f948..d0c25a466e72 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@@ -94,6 +94,11 @@ class TaskProcessingContext:def interaction_origin(self) -> str | None:return (self.state or {}).get("interaction_origin")+ @property+ def auto_publish(self) -> bool:+ """User-opted auto-publish: the agent pushes and opens a draft PR on completion."""+ return (self.state or {}).get("auto_publish") is True+@propertydef has_github_credentials(self) -> bool:return self.github_integration_id is not None or self.github_user_integration_id is not Nonediff --git a/products/tasks/backend/temporal/process_task/activities/start_agent_server.py b/products/tasks/backend/temporal/process_task/activities/start_agent_server.pyindex eae0a2e25890..60f9dffafee2 100644--- a/products/tasks/backend/temporal/process_task/activities/start_agent_server.py+++ b/products/tasks/backend/temporal/process_task/activities/start_agent_server.py@@ -285,6 +285,7 @@ def _invoke_start_agent_server(run_id=ctx.run_id,mode=ctx.mode,create_pr=ctx.create_pr,+ auto_publish=ctx.auto_publish,interaction_origin=ctx.interaction_origin,branch=params.protected_base_branch,runtime_adapter=ctx.runtime_adapter,diff --git a/products/tasks/backend/temporal/process_task/utils.py b/products/tasks/backend/temporal/process_task/utils.pyindex c840c880fc90..2b6974f1a83e 100644--- a/products/tasks/backend/temporal/process_task/utils.py+++ b/products/tasks/backend/temporal/process_task/utils.py@@ -246,6 +246,7 @@ def is_resume_snapshot_usable(kind: SnapshotKind, mount_path: str | None) -> booclass RunState(BaseModel, extra="allow"):pr_authorship_mode: PrAuthorshipMode | None = None+ auto_publish: bool | None = Nonegithub_credential_source: GitHubCredentialSource | None = Nonepr_base_branch: str | None = Nonehome_quick_action: str | None = Nonediff --git a/products/tasks/backend/tests/test_agentsh.py b/products/tasks/backend/tests/test_agentsh.pyindex b49bfeb77502..fb8423b08d05 100644--- a/products/tasks/backend/tests/test_agentsh.py+++ b/products/tasks/backend/tests/test_agentsh.py@@ -291,6 +291,90 @@ class TestModalSandboxAgentShWrapping(TestCase):self.assertNotIn(ENV_WRAPPER_SCRIPT, cmd)self.assertIn("nohup", cmd)+ @parameterized.expand(+ [+ ("modal", True),+ ("modal", False),+ ("docker", True),+ ("docker", False),+ ]+ )+ def test_command_includes_auto_publish_flag_only_when_opted_in(self, provider, auto_publish):+ from products.tasks.backend.logic.services.docker_sandbox import DockerSandbox+ from products.tasks.backend.logic.services.modal_sandbox import ModalSandbox++ sandbox: ModalSandbox | DockerSandbox+ if provider == "modal":+ sandbox = ModalSandbox.__new__(ModalSandbox)+ else:+ sandbox = DockerSandbox.__new__(DockerSandbox)+ cmd = sandbox._build_agent_server_command(+ repo_path="/tmp/workspace/repos/org/repo",+ task_id="test-task",+ run_id="test-run",+ mode="background",+ create_pr=True,+ auto_publish=auto_publish,+ )+ # Opt-out runs must not see the flag at all: agent-server builds without+ # the option reject unknown flags, so appending it would break every run.+ if auto_publish:+ self.assertIn("--autoPublish true", cmd)+ else:+ self.assertNotIn("--autoPublish", cmd)++ @parameterized.expand(+ [+ ("modal", True),+ ("modal", False),+ ("docker", True),+ ("docker", False),+ ]+ )+ def test_start_agent_server_drops_auto_publish_when_binary_lacks_support(self, provider, supported):+ from products.tasks.backend.logic.services.docker_sandbox import DockerSandbox+ from products.tasks.backend.logic.services.modal_sandbox import ModalSandbox+ from products.tasks.backend.logic.services.sandbox import ExecutionResult++ # Snapshots restored from old images carry an agent-server that rejects unknown+ # options; the launch probe must drop --autoPublish instead of crashing the run.+ launched: list[str] = []++ def execute(command: str, timeout_seconds: int | None = None) -> ExecutionResult:+ if "--taskId" in command:+ launched.append(command)+ return ExecutionResult(stdout="", stderr="", exit_code=0)+ self.assertIn("grep", command)+ return ExecutionResult(stdout="", stderr="", exit_code=0 if supported else 1)++ sandbox: ModalSandbox | DockerSandbox+ if provider == "modal":+ sandbox = ModalSandbox.__new__(ModalSandbox)+ else:+ sandbox = DockerSandbox.__new__(DockerSandbox)+ sandbox._host_port = 8080+ sandbox.id = "sb-test"+ cast_sandbox: Any = sandbox+ cast_sandbox.is_running = Mock(return_value=True)+ cast_sandbox._agent_server_is_healthy = Mock(return_value=False)+ cast_sandbox._free_agent_server_port = Mock()+ cast_sandbox.write_file = Mock()+ cast_sandbox.execute = execute++ sandbox.start_agent_server(+ repository="org/repo",+ task_id="test-task",+ run_id="test-run",+ auto_publish=True,+ wait_for_health=False,+ )++ self.assertEqual(len(launched), 1)+ if supported:+ self.assertIn("--autoPublish true", launched[0])+ else:+ self.assertNotIn("--autoPublish", launched[0])+def test_command_includes_allowed_domains(self):from products.tasks.backend.logic.services.modal_sandbox import ModalSandboxdiff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.pyindex dbbb3282bf32..b9bf164fd131 100644--- a/products/tasks/backend/tests/test_api.py+++ b/products/tasks/backend/tests/test_api.py@@ -1636,6 +1636,7 @@ class TestTaskAPI(BaseTaskAPITest):"reasoning_effort": "high","initial_permission_mode": "auto","run_source": "manual",+ "auto_publish": True,},format="json",)@@ -1653,6 +1654,7 @@ class TestTaskAPI(BaseTaskAPITest):self.assertEqual(task_run.state["reasoning_effort"], "high")self.assertEqual(task_run.state["initial_permission_mode"], "auto")self.assertEqual(task_run.state["run_source"], "manual")+ self.assertEqual(task_run.state["auto_publish"], True)mock_workflow.assert_not_called()@patch("products.tasks.backend.temporal.client.execute_task_processing_workflow")diff --git a/products/tasks/backend/tests/test_warm_facade.py b/products/tasks/backend/tests/test_warm_facade.pyindex 9cf92ed3377d..f50c602d49ff 100644--- a/products/tasks/backend/tests/test_warm_facade.py+++ b/products/tasks/backend/tests/test_warm_facade.py@@ -170,7 +170,7 @@ class TestCreateTaskWarmReuse(APIBaseTest):def test_reuses_matching_warm_task_and_activates_it_in_place(self):warm_task, run = self._warm_run()with patch(f"{FACADE}.signal_task_run_user_message", return_value=True) as m_signal:- dto = self._create()+ dto = self._create(auto_publish=True)assert str(dto.id) == str(warm_task.id)assert Task.objects.filter(team=self.team, deleted=False).count() == 1@@ -182,6 +182,9 @@ class TestCreateTaskWarmReuse(APIBaseTest):_, kwargs = m_signal.call_argsassert kwargs["content"] == "fix the bug"assert "await_user_message" not in run.state+ # The agent-server re-reads run state on the forwarded first message, so this+ # must be persisted for the warm run to honor the setting.+ assert run.state.get("auto_publish") is Truedef test_does_not_overwrite_existing_warm_description(self):warm_task, _ = self._warm_run()@@ -321,7 +324,12 @@ class TestRunTaskWarmActivation(APIBaseTest):task.id,self.team.id,self.user.id,- validated_data={"mode": "interactive", "branch": "main", "pending_user_message": "do the thing"},+ validated_data={+ "mode": "interactive",+ "branch": "main",+ "pending_user_message": "do the thing",+ "auto_publish": True,+ },)assert result is not None and result.error is None@@ -331,6 +339,7 @@ class TestRunTaskWarmActivation(APIBaseTest):assert kwargs["content"] == "do the thing"run.refresh_from_db()assert "await_user_message" not in run.state+ assert run.state.get("auto_publish") is Truedef test_falls_back_to_description_when_no_pending_message(self):task, run = self._warm_run()diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.tsindex 7db3c9c01a65..e25374b1fe3a 100644--- a/products/tasks/frontend/generated/api.schemas.ts+++ b/products/tasks/frontend/generated/api.schemas.ts@@ -597,6 +597,11 @@ export interface TaskWriteApi {* @items.maxLength 128*/pending_user_artifact_ids?: string[]+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead.+ * @nullable+ */+ auto_publish?: boolean | null/*** Channel this task is owned by (the channel it was kicked off in).* @nullable@@ -705,6 +710,11 @@ export interface PatchedTaskWriteApi {* @items.maxLength 128*/pending_user_artifact_ids?: string[]+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead.+ * @nullable+ */+ auto_publish?: boolean | null/*** Channel this task is owned by (the channel it was kicked off in).* @nullable@@ -818,6 +828,11 @@ export interface ClaudeTaskRunCreateSchemaApi {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnumApi+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manual@@ -905,6 +920,11 @@ export interface CodexTaskRunCreateSchemaApi {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnumApi+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manual@@ -1351,6 +1371,11 @@ export interface TaskRunBootstrapCreateRequestApi {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnumApi+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manualdiff --git a/products/tasks/frontend/generated/api.zod.ts b/products/tasks/frontend/generated/api.zod.tsindex fc61a10b2f11..6617f954b6a8 100644--- a/products/tasks/frontend/generated/api.zod.ts+++ b/products/tasks/frontend/generated/api.zod.ts@@ -374,6 +374,12 @@ export const TasksCreateBody = /* @__PURE__ */ zod.describe("Run artifact ids (already uploaded to the pre-warmed Run) to attach to the forwarded first message when creation reuses that warm Run, e.g. skill bundles or file attachments. If any id is missing from the warm Run's manifest, warm reuse is skipped and the task is created cold. Ignored when no warm Run is matched."),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ "When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead."+ ),channel: zod.uuid().nullish().describe('Channel this task is owned by (the channel it was kicked off in).'),}).describe(@@ -499,6 +505,12 @@ export const TasksUpdateBody = /* @__PURE__ */ zod.describe("Run artifact ids (already uploaded to the pre-warmed Run) to attach to the forwarded first message when creation reuses that warm Run, e.g. skill bundles or file attachments. If any id is missing from the warm Run's manifest, warm reuse is skipped and the task is created cold. Ignored when no warm Run is matched."),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ "When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead."+ ),channel: zod.uuid().nullish().describe('Channel this task is owned by (the channel it was kicked off in).'),}).describe(@@ -624,6 +636,12 @@ export const TasksPartialUpdateBody = /* @__PURE__ */ zod.describe("Run artifact ids (already uploaded to the pre-warmed Run) to attach to the forwarded first message when creation reuses that warm Run, e.g. skill bundles or file attachments. If any id is missing from the warm Run's manifest, warm reuse is skipped and the task is created cold. Ignored when no warm Run is matched."),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ "When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead."+ ),channel: zod.uuid().nullish().describe('Channel this task is owned by (the channel it was kicked off in).'),}).describe(@@ -701,6 +719,12 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([.describe('Whether pull requests for this run should be authored by the user or the bot.\n\n\* `user` - user\n\* `bot` - bot'),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ 'When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.'+ ),run_source: zod.enum(['manual', 'signal_report']).describe('\* `manual` - manual\n\* `signal_report` - signal_report')@@ -780,6 +804,12 @@ export const TasksRunCreateBody = /* @__PURE__ */ zod.union([.describe('Whether pull requests for this run should be authored by the user or the bot.\n\n\* `user` - user\n\* `bot` - bot'),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ 'When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.'+ ),run_source: zod.enum(['manual', 'signal_report']).describe('\* `manual` - manual\n\* `signal_report` - signal_report')@@ -1104,6 +1134,12 @@ export const TasksRunsCreateBody = /* @__PURE__ */ zod.describe('Whether pull requests for this run should be authored by the user or the bot.\n\n\* `user` - user\n\* `bot` - bot'),+ auto_publish: zod+ .boolean()+ .nullish()+ .describe(+ 'When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.'+ ),run_source: zod.enum(['manual', 'signal_report']).describe('\* `manual` - manual\n\* `signal_report` - signal_report')diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex d330ed3f329d..7985259f2d12 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -12940,6 +12940,11 @@ export namespace Schemas {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnum;+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null;/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manual@@ -13287,6 +13292,11 @@ export namespace Schemas {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnum;+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null;/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manual@@ -43241,6 +43251,11 @@ export namespace Schemas {* @items.maxLength 128*/pending_user_artifact_ids?: string[];+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead.+ * @nullable+ */+ auto_publish?: boolean | null;/*** Channel this task is owned by (the channel it was kicked off in).* @nullable@@ -54183,6 +54198,11 @@ export namespace Schemas {* * `user` - user* * `bot` - bot */pr_authorship_mode?: PrAuthorshipModeEnum;+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.+ * @nullable+ */+ auto_publish?: boolean | null;/** High-level source that triggered this run, used to distinguish manual and signal-based cloud runs.** * `manual` - manual@@ -54600,6 +54620,11 @@ export namespace Schemas {* @items.maxLength 128*/pending_user_artifact_ids?: string[];+ /**+ * When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask. Write-only and not persisted on the task: persisted into the reused warm Run's state when creation activates one, so resumes of that Run honor it. Ignored when no warm Run is reused — cold creation takes it via the run start endpoint instead.+ * @nullable+ */+ auto_publish?: boolean | null;/*** Channel this task is owned by (the channel it was kicked off in).* @nullable