Skip to content

fix(agent): end a bake once the server moves past it - #835

Merged
notheotherben merged 1 commit into
mainfrom
claude/project-thread-lu4ufp
Nov 6, 2026
Merged

notheotherben merged 1 commit into
mainfrom
claude/project-thread-lu4ufp

Conversation

@notheotherben

Copy link
Copy Markdown
Member

Requested by Ben · project thread

Follow-up to #834. Expediting the last baking host left its stage in baking with no countdown and no row left to expedite, until the host's original window ran out.

Cause

  • A bake (RunHealth with until) samples checks in the target's queue (host queue, or the cluster's lane) until its window ends.
  • Expedite ends the bake on the server only. The phase then starts its pre-phase gate (start_gate → PhaseState::Baking), whose Rollout-scope health request queues behind the still-running bake loop on the expedited host.
  • The same applies to a next step's plan/apply after an expedited step.

Fix

  • session/bakes.rs: as instructions arrive, a bake registers a stop token per (cluster, workload) target; a later RequestPlan, Apply, Rollback, or Baseline/Bake/Rollout health check for the same target cancels it. A bake superseded before it starts takes one sample.
  • Host (session.rs) and lane (targets.rs) bake loops end on that token. Manual/Drift health and other workloads' instructions leave a bake alone.

Tests

  • a_bake_ends_when_the_server_moves_past_it (gate, newer bake) and a_cluster_bake_ends_when_the_server_moves_past_it: the next request is answered within 2m of a 15m bake and the old bake stops sampling. Both fail without the fix.

Takes effect once agents run this release (Upgrade agent).


Generated by Claude Code

A bake samples a target's checks until its window ends, in that target's
queue (the host's, or the cluster's lane). Expediting a bake ends it on
the server only, so the agent kept sampling and every later instruction
for the target waited behind it: the next phase's gate health check, the
next step's plan or apply. The stage showed 'baking' with nothing left
baking until the old window ran out.

A later rollout instruction for the same target (plan, apply, rollback,
or a baseline/bake/rollout health check) now stops that target's bake as
it arrives, so it is answered at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkowUvm9YTtraeGrudHmJJ
@notheotherben notheotherben self-assigned this Nov 6, 2026
@notheotherben
notheotherben merged commit 6f86dfa into main Nov 6, 2026
7 checks passed
@notheotherben
notheotherben deleted the claude/project-thread-lu4ufp branch November 6, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants