Skip to content

End ready leases only by the idle and lifetime rules - #42

Merged
lydakis merged 6 commits into
mainfrom
claude/errand-simple-holds
Oct 6, 2026
Merged

lydakis merged 6 commits into
mainfrom
claude/errand-simple-holds

Conversation

@lydakis

@lydakis lydakis commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Before: a run held its lease from hand-out until it settled. If it stopped after the machine was ready but before a job was admitted, it withdrew, and the cloud peer released the lease at its next check unless a job was running. That needed a holders list, a Used bit, a client-side claim settled after submission, and a Shared answer field. Most of the late review findings on the cloud stack landed in this protocol.

After: withdrawing only cancels a launch. A run that stops while its lease is launching withdraws, and the launch stops once no other run is waiting for it. A ready lease belongs to no run: it ends when idle, at its lifetime, or when released. A run that stops after its machine is ready leaves it up for at most one idle window.

How: the broker record keeps only requests (runs waiting for a launching lease, also used to answer a retried request with the same lease). Used, holders, the unheld release reason, Shared, and client.Claim with its admission tracking are gone. Lease guarantees 2 and 3 in DESIGN.md and the CLOUD.md paragraph are rewritten to match, and the broker and CLI tests follow.

Includes #41's one-line test fix so internal/cloud passes; it drops out once #41 merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6


Generated by Claude Code

claude added 3 commits October 6, 2026 00:28
#35 made the broker require one, and #26's test was written before it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
#35 made the broker require one, and #26's test was written before it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
A run no longer holds its lease once the machine is ready. Withdrawing
now only cancels a launch that no other run is waiting for; a ready
lease ends when it is idle, at its lifetime, or when released. This
drops the Used bit, the client's claim and settle step, and the Shared
field, at the cost of up to one idle window after a run that stops once
its machine is ready.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6

lydakis commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

github-advanced-security failed here. It is GitHub's Copilot code scanning job, which fails on GitHub's side (model or quota) and not because of this diff. It has been red the same way on the other PRs, and re-running it from here returns 403, so there is no fix to port.


Generated by Claude Code

claude added 3 commits October 6, 2026 00:37
TestFailedLaunchesAreReleased gave the acquire command 200ms, which a
loaded machine can exceed before readiness is ever checked, and
TestReleaseRetriesUntilItSucceeds assumed the first release attempt had
failed after a fixed 100ms. Both failed under a full -race run on a Mac.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
@lydakis
lydakis marked this pull request as ready for review October 6, 2026 00:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T00:47:26.992336Z a8de1f3 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-06T00:46:30.196098Z a8de1f3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8de1f32b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cloud/broker.go Resolved
@lydakis
lydakis merged commit 260c0fc into main Oct 6, 2026
8 of 9 checks passed
@lydakis
lydakis deleted the claude/errand-simple-holds branch October 6, 2026 01:00
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