Add allow_queue option to job execution create - #226
Conversation
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>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| env: Dict[str, str] | None = None, | ||
| memory: int | None = None, | ||
| execution_id: str | None = None, | ||
| allow_queue: bool | None = None, |
There was a problem hiding this comment.
🟡 New allow_queue feature ships without an integration test
AGENTS.md requires every feature to ship with an integration test against the real API. The new allow_queue parameter on run/arun has no test in tests/integration/core/jobs/test_jobs.py, unlike the existing memory and env overrides.
Prompt for agents
AGENTS.md states every feature must ship with an integration test exercising it against the real API. The new allow_queue option added to BlJob.run and BlJob.arun (and the CreateJobExecutionRequest model) has no integration test. Add a test in tests/integration/core/jobs/test_jobs.py that runs a job with allow_queue=False (and/or True), following the existing patterns like test_run_job_with_memory_override, including the not-found skip handling.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Addressed in follow-up PR #227 (this PR was already merged): adds test_run_job_with_allow_queue_false to tests/integration/core/jobs/test_jobs.py, treating an immediate 429 as the expected no-capacity rejection.
Summary
Surfaces the new
allowQueueparameter from controlplane (blaxel-ai/controlplane#5229) in the Python SDK.src/blaxel/core/client/models/create_job_execution_request.py: regenerated viamake sdk-controlplanefrommain—CreateJobExecutionRequestgains optionalallow_queue(serialized asallowQueue).BlJob.run/BlJob.arungain anallow_queue: bool | None = Noneparameter forwarded on the create request.Semantics: omitted or
Truekeeps today's queue-and-retry behavior;allow_queue=Falsechecks capacity synchronously at create time and rejects immediately with a 429 (no execution created, nothing queued) so callers can fail over instantly instead of waiting on a parked execution.ruff check/ruff formatclean; verified serialization:CreateJobExecutionRequest(tasks=[{}], allow_queue=False).to_dict() == {'allowQueue': False, 'tasks': [{}]}.Link to Devin session: https://app.devin.ai/sessions/829498efd05742f79300261953889d6d
Requested by: @drappier-charles
Note
Low Risk
Additive optional SDK field with default-preserving behavior; no auth, data, or execution-path logic changes in this repo.
Overview
Adds optional
allow_queueonCreateJobExecutionRequest(serialized asallowQueue) and forwards it fromBlJob.run/BlJob.arun.Omitted or
Truekeeps queue-and-retry.allow_queue=Falseasks the control plane to reject immediately with 429 if the job cannot start now, so callers can fail over without a parked execution.Reviewed by Cursor Bugbot for commit c5bd78b. Bugbot is set up for automated code reviews on this repo. Configure here.