From 651d997c807de697172da2cc8a57c363628ddcf1 Mon Sep 17 00:00:00 2001 From: cdrappier Date: Fri, 21 Aug 2026 20:25:52 +0000 Subject: [PATCH 1/2] Add allow_queue option to job execution create Regenerates the controlplane client from main (adds optional allowQueue on CreateJobExecutionRequest) and exposes allow_queue on BlJob.run/arun. allow_queue=False rejects immediately with 429 when capacity is unavailable instead of queueing; omitted/True keeps queue-and-retry. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../client/models/create_job_execution_request.py | 11 +++++++++++ src/blaxel/core/jobs/__init__.py | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/blaxel/core/client/models/create_job_execution_request.py b/src/blaxel/core/client/models/create_job_execution_request.py index 110a3a1b..98f0c437 100644 --- a/src/blaxel/core/client/models/create_job_execution_request.py +++ b/src/blaxel/core/client/models/create_job_execution_request.py @@ -18,6 +18,9 @@ class CreateJobExecutionRequest: """Request to create a job execution Attributes: + allow_queue (Union[Unset, bool]): When false, capacity is checked synchronously and the request is rejected + immediately with a 429 error if the execution cannot start right now, instead of being queued and retried in the + background. No execution is created on rejection. Defaults to true (queue and retry). env (Union[Unset, CreateJobExecutionRequestEnv]): Environment variable overrides (optional, will merge with job's environment variables) Example: {"MY_VAR": "custom_value", "BATCH_SIZE": "100"}. execution_id (Union[Unset, str]): Execution ID (optional, will be generated if not provided) @@ -30,6 +33,7 @@ class CreateJobExecutionRequest: workspace_id (Union[Unset, str]): Workspace ID """ + allow_queue: Union[Unset, bool] = UNSET env: Union[Unset, "CreateJobExecutionRequestEnv"] = UNSET execution_id: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET @@ -41,6 +45,8 @@ class CreateJobExecutionRequest: def to_dict(self) -> dict[str, Any]: + allow_queue = self.allow_queue + env: Union[Unset, dict[str, Any]] = UNSET if self.env and not isinstance(self.env, Unset) and not isinstance(self.env, dict): env = self.env.to_dict() @@ -70,6 +76,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if allow_queue is not UNSET: + field_dict["allowQueue"] = allow_queue if env is not UNSET: field_dict["env"] = env if execution_id is not UNSET: @@ -97,6 +105,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: if not src_dict: return None d = src_dict.copy() + allow_queue = d.pop("allowQueue", d.pop("allow_queue", UNSET)) + _env = d.pop("env", UNSET) env: Union[Unset, CreateJobExecutionRequestEnv] if isinstance(_env, Unset): @@ -122,6 +132,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: workspace_id = d.pop("workspaceId", d.pop("workspace_id", UNSET)) create_job_execution_request = cls( + allow_queue=allow_queue, env=env, execution_id=execution_id, id=id, diff --git a/src/blaxel/core/jobs/__init__.py b/src/blaxel/core/jobs/__init__.py index 6ac94d8b..2cf53d6f 100644 --- a/src/blaxel/core/jobs/__init__.py +++ b/src/blaxel/core/jobs/__init__.py @@ -86,6 +86,7 @@ def run( env: Dict[str, str] | None = None, memory: int | None = None, execution_id: str | None = None, + allow_queue: bool | None = None, ) -> str: """ Run the job with the provided tasks and optional overrides. @@ -95,6 +96,10 @@ def run( env: Optional environment variable overrides (merged with job's environment) memory: Optional memory override in megabytes (must be <= job's configured memory) execution_id: Optional custom execution ID + allow_queue: When False, capacity is checked synchronously and the request is + rejected immediately with a 429 error if the execution cannot start right + now, instead of being queued and retried in the background. Omitted or + True keeps the queue-and-retry behavior. Returns: str: The execution ID @@ -111,6 +116,8 @@ def run( request.memory = memory if execution_id is not None: request.execution_id = execution_id + if allow_queue is not None: + request.allow_queue = allow_queue return self.create_execution(request) @@ -120,6 +127,7 @@ async def arun( env: Dict[str, str] | None = None, memory: int | None = None, execution_id: str | None = None, + allow_queue: bool | None = None, ) -> str: """ Run the job with the provided tasks and optional overrides (async). @@ -129,6 +137,10 @@ async def arun( env: Optional environment variable overrides (merged with job's environment) memory: Optional memory override in megabytes (must be <= job's configured memory) execution_id: Optional custom execution ID + allow_queue: When False, capacity is checked synchronously and the request is + rejected immediately with a 429 error if the execution cannot start right + now, instead of being queued and retried in the background. Omitted or + True keeps the queue-and-retry behavior. Returns: str: The execution ID @@ -145,6 +157,8 @@ async def arun( request.memory = memory if execution_id is not None: request.execution_id = execution_id + if allow_queue is not None: + request.allow_queue = allow_queue return await self.acreate_execution(request) From c5bd78be268892e86bdb5d0ef3e4836dc629b60f Mon Sep 17 00:00:00 2001 From: cdrappier Date: Fri, 21 Aug 2026 20:38:35 +0000 Subject: [PATCH 2/2] chore: retrigger CI (sandbox lifecycle flake in integration tests) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>