From 79e6a8db00e6de6c0b0e7586948747e9112d9f5e Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Mon, 1 Jun 2026 02:30:38 -0700 Subject: [PATCH] feat(agent-queue): honor a job's explicit engine on fleet claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When materializing a claimed fleet job, write `engine: ` into the job frontmatter (resolve_engine then runs it). Only a KNOWN engine (devin/claude/codex/copilot) is honored — never the run's 'unknown'/class placeholder — so an engineless job still falls back to the factory default (AGENT_QUEUE_ENGINE). No behavior change for existing jobs. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- agent-queue/lib/fleet-client.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent-queue/lib/fleet-client.sh b/agent-queue/lib/fleet-client.sh index ccfa915..9fdec81 100644 --- a/agent-queue/lib/fleet-client.sh +++ b/agent-queue/lib/fleet-client.sh @@ -241,7 +241,7 @@ fleet_claim() { case "$FLEET_CODE" in 2*) :;; *) err "fleet: claim failed (HTTP ${FLEET_CODE:-error})"; return 1;; esac printf '%s' "$FLEET_BODY" | grep -q '"claimed"[[:space:]]*:[[:space:]]*true' || return 2 - local jid body_md epoch repo base_branch verify automerge="" + local jid body_md epoch repo base_branch verify automerge="" engine_pick jid=$(printf '%s' "$FLEET_BODY" | _json_str id) body_md=$(printf '%s' "$FLEET_BODY" | _json_str bodyMd) epoch=$(printf '%s' "$FLEET_BODY" | _fleet_json_num leaseEpoch) @@ -249,6 +249,11 @@ fleet_claim() { base_branch=$(printf '%s' "$FLEET_BODY" | _json_str baseBranch) verify=$(printf '%s' "$FLEET_BODY" | _json_str verify) printf '%s' "$FLEET_BODY" | grep -q '"autoMerge"[[:space:]]*:[[:space:]]*true' && automerge=true + # Concrete engine the submitter picked (job.engine wins over engineClass via + # resolve_engine). Only honor a KNOWN engine — never the run's 'unknown'/class + # placeholder — so an engineless job still falls back to the factory default. + engine_pick=$(printf '%s' "$FLEET_BODY" | _json_str engine) + case "$engine_pick" in devin | claude | codex | copilot) ;; *) engine_pick="" ;; esac [[ -n "$jid" ]] || { err "fleet: claim returned no job id"; return 1; } # Materialize a transient local job .md (same approach as from-tracker) so the @@ -264,6 +269,7 @@ fleet_claim() { echo "yolo: true" echo "fleet-job-id: $jid" echo "fleet-lease-epoch: ${epoch:-0}" + [[ -n "$engine_pick" ]] && echo "engine: $engine_pick" [[ -n "$repo" ]] && echo "fleet-repo: $repo" [[ -n "$base_branch" ]] && echo "fleet-base-branch: $base_branch" # Per-repo verify command (drives the existing verify gate) + auto-merge flag.