Skip to content

fix(leasing): no device work for a waiter the queue has just rejected (#665) - #669

Merged
V3RON merged 4 commits into
mainfrom
bug/665
Oct 17, 2026
Merged

V3RON merged 4 commits into
mainfrom
bug/665

Conversation

@V3RON

@V3RON V3RON commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #665

Status

Implement: done (600/600 leasing, 2354/2354 changed; both probes red) Review: round 1 passed (spec, code, claims: F0) Hardware: n/a Gate: running
Next: gate result

  • #decide plans no device work for a waiter markProcessing has just rejected — the guard at src/leasing/lease-acquisition-coordinator.ts:904 mirrors the ready-grant branch the report points at; the new eviction test drives a real timeoutMs deadline falling due inside the eviction and fails on createdModels gaining "iPhone 16" without the guard
  • A refused plan gives back what it holds — releasePlanResources; deleting only that release turns the eviction test red on reservedRunning: 1 and all three table cases red on NoCapacityError for the next request
  • The refusal leaves nothing queued behind a plan nobody performs — each table case asserts outcome: "pending" with queueDepth: 0

Only the refused plan's own work disappears. The caller's answer is unchanged: the queue's own
expiry had already settled it with QueueTimeoutError.

Assumptions

  • Assumption: a refused markProcessing on the operation branch ends the drive silently, as the ready-grant branch already does — the queue refused because the waiter is at its deadline and already rejected; deferring would re-queue a dead waiter.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 1 note.
Rounds: 1. Tokens: n/a.

Fixed unreviewed (text, commit a3d448ae: comments only, no assertion changed):

  • claims: src/leasing/lease-acquisition-coordinator.test.ts:1549 the why: named a capacity reservation for the two evict-* cases, which hold a claim only; the guard's own comment said the same and was fixed with it

Kind full, so all three reviews ran; the code reviewer with lens: both in its own worktree of 3cb8cada. Inputs came from .agents/scripts/review-inputs.sh 669 (rules, ADRs and briefs from main).

How the reviews were spawned: this session sits at subagent depth and the harness refused nested spawns, as on #643, #644, #646, #649 and #650. Each reviewer ran as a fresh detached session reading only the inputs directory and its own worktree of the reviewed commit, with no PR body, commit messages or another reviewer's output, and read .agents/briefs/calibration.md first. Two deviations, both disclosed: the claude CLI reported its monthly spend limit exhausted until 2026-10-18 15:00, so the children ran as detached opencode run sessions rather than detached claude -p ones; the pinned reviewer models (opus, sonnet) are not reachable there, so each ran on the one model that was. Nothing was reviewed by the agent that wrote the code.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 17, 2026 12:32
@V3RON
V3RON merged commit 9b0193d into main Oct 17, 2026
43 checks passed
@V3RON
V3RON deleted the bug/665 branch October 17, 2026 12:39
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.

A provision planned after #markNew is performed for a waiter markProcessing has just rejected

1 participant