Repository navigation
Description
The cloud work was split into #31 (GPU where terms), #32 (leasing with provider commands) and #26 (Lambda provider). Those PRs are gated on P1 and above. Lower-severity review findings and agreed follow-ups are tracked here instead of being patched one at a time. Lease rules referenced below are the "Lease guarantees" in docs/DESIGN.md.
Open review findings (P2)
- Busy observation lost on a failed write. When persisting
LastBusyafter a busy probe fails transiently, the old idle deadline can release a lease soon after the job finishes. The fix is to retry the write or keep the observation in memory until it persists. (internal/cloud/broker.go, watch) Fix in Keep cloud leases alive while in use and bound what the cloud peer keeps #45: the idle clock is kept in memory, so a failed write cannot lose a busy observation. - Lease identity dropped without a host key. A command provider that returns an
sshtarget withouthost_keygets no lease identity on the client, so its machine cannot admit the client's errand key. The fix is to offer the lease identity whether or not the host key is pinned. (cmd/errand/leases.go) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46. - Invalid provider targets accepted. Targets with both
urlandssh, a non-HTTP URL, a bad SSH name or a malformed host key are accepted and only fail later at the client. They should be rejected when acquire returns, with the same validation the client uses. (internal/cloud/provider.go) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46. - Discovered leases are not claimed. A ready lease found through
/v0/info(by--whereor--on <lease>) becomes an ordinary candidate with no claim, so guarantee 5 (a full idle window from hand-out) does not cover it. The fix is to make reuse of a discovered lease go through the cloud peer as a hand-out. (cmd/errand/placement.go) Fix in Keep cloud leases alive while in use and bound what the cloud peer keeps #45:--where,--on <lease>andpush --on <lease>claim the lease through the cloud peer right before their first request that changes anything.
Follow-ups from the outside reviews
- Results end with the lease. Fixed in Keep a lease up while finished jobs' results are unfetched #59: unfetched results of jobs run during a lease keep it up until
max_lifetime; persistent workspaces still end with it. Retained results and persistent workspaces on a leased machine end with it. One option is to keep the idle clock running until finished results have been fetched. - Admission race at the idle deadline. A job admitted in the second or two between an idle check and the termination can lose its machine. Closing this needs the runner to refuse new jobs while it is being drained. Handled by the claim in Keep cloud leases alive while in use and bound what the cloud peer keeps #45: a claim and an idle release are decided under one lock on the cloud peer, so whichever is recorded first wins, and a refused claim gets 409 and the run picks another lease. What remains is a submission that never claims (a direct URL), which fails visibly. A runner-side hold was built and then split out to branch
claude/errand-lease-hold; George decided 2026-10-06 to leave it parked. Revive it only on evidence of jobs lost at the idle deadline, or if a supported way to submit without claiming appears (such as third-party clients).
Follow-ups found while fixing these
-
Uploads do not count as busy. Fixed in Count workspace uploads in progress as runner work #57. The runner's busy probe counts jobs, not workspace uploads, so a
push --on <lease>upload that outlastsidle_timeoutcan be released mid-upload. This is already true on main. The fix is for the runner to count an upload in progress as occupancy. -
No SSH transport to Windows runners, so Windows SSH lease admission is deferred with it. George decided 2026-10-06 that this stays a documented limitation of the experimental Windows runner (WINDOWS.md, and CLOUD.md in Note that leased Windows machines need the tailnet #61) until SSH on Windows gets proper support.
-
Comment items above. Every item in the comments is fixed (ticked with its PR), except SSH admission on Windows targets (needs SSH transport to Windows runners, a separate feature) and the two Rent from a Lambda account with one setting #47 follow-ups: offers above
max_price_per_hourstill advertised (waiting on George's OK for a field onproto.Offer), and the dev-build cloud peer (fixed in List Lambda types a cloud peer has no errand build for as unavailable #50).
Generated by Claude Code
Activity
lydakis commentedon Oct 5, 2026
From the Codex review of #26 at bb8e342 (P2): progress tail rotation. Once an acquire command has printed more than 100 progress lines, the broker drops one old line for each new one. The tail's length then stays at 100, so
followLeasenever sees it shrink and prints nothing more for that launch. The fix is to carry a progress sequence number in the lease, so the client prints the lines after the last one it showed, rather than treating a shorter tail as the sign that lines were trimmed.Generated by Claude Code
lydakis commentedon Oct 5, 2026
From the Codex review of #35 at 4183fc8 (P2): SSH admission on Windows targets. The script that admits another device's key is POSIX shell (
umask,mkdir -p, awhile readloop). A Windows runner leased over OpenSSH would leave the key pending, so reuse from a second device, and--on, would wait and then fail. A fix needs admission that works on any target, or one chosen by the leased runner's OS.Generated by Claude Code
lydakis commentedon Oct 5, 2026
One more P2, from the Codex review of #35:
IdleUntil, the admission request queues the key but doesn't refreshLastBusyor add a holder. The worker admits the key, probes before the client can submit, and then releases the still-idle lease. The fix is to record a usage window or a temporary holder for the admission request. (internal/cloud/broker.go, AdmitLeaseKey) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.Generated by Claude Code
lydakis commentedon Oct 5, 2026
More P2s from the latest Codex reviews of #32 and #26. Two of the #32 findings repeat items already listed here: lease identity without a host key, and invalid provider targets, which now also notes that they keep the machine until
acquire_timeout.cmd/errand/leases.go) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46.max_leasesbounds only active leases, so acquire/release churn piles up goroutines and history records./v0/leasescan eventually grow past the client's 16 MiB limit. A broker-level reaper or a bounded history would fix it. (internal/cloud/broker.go) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.POST /v0/leasesanswering 404 is not treated as a safe refusal, so the client doesn't try the next cloud peer. (internal/client/leases.go) Fixed in Settle ambiguous lease requests and keep showing launch progress #43.l.Wherein waitReady.applyLockedcan replace the record concurrently, which is a data race. The fix is to pass thewherecaptured under the lock inlaunch. (internal/cloud/broker.go) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.readSecretchecks only the owner SID, so a file whose inherited ACL lets other local users read it is still accepted. (Add the built-in Lambda provider (experimental) #26,internal/cloud/lambda.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.Generated by Claude Code
lydakis commentedon Oct 5, 2026
#32 changes since the last update:
--wherein Lease machines from cloud peers (provider commands) #32 (307e8df). A ready lease is now reused only by asking its cloud peer, which hands it to the run as a holder.--on <lease>still runs on a listed lease directly.New P2s from the Codex review of #32 at 0600050:
Acquireanswers 404 before it looks up the existing(owner, requestID). The ready lease keeps running until it goes idle. (internal/cloud/broker.go) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.sshRoundTripperpools by target, command and socket. An unpinned connection to the sameuser@hostopened before the lease's host key was trusted can be reused for the lease. (internal/client/ssh_pin.go) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46..pubfile rebuilt byssh-keygen -yloses theerrandcomment. Exact comparison then hides existing SSH leases, and the broker launches a second machine. Compare type and blob only. (cmd/errand/leases.go, broker reuse) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46.Generated by Claude Code
lydakis commentedon Oct 5, 2026
One more P2, from the Codex review of #35 at 0cef48c:
PendingKeys/SSHKeyswithout limit. Past ~1 MiB,GetLeaserejects the response, so admission can no longer complete. The fix is to cap the keys kept per lease. (internal/cloud/broker.go) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.Generated by Claude Code
lydakis commentedon Oct 5, 2026
Two more P2s, from the Codex review of #32 at 307e8df:
price_per_hour = 0counts as unpriced. A free offer can be ordered after an unpriced one. The fix is to keep track of whether the field was set at all, instead of testing> 0. (internal/placement/requirements.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.showncounter never catches new lines. (cmd/errand/leases.go, followLease) Fixed in Settle ambiguous lease requests and keep showing launch progress #43.Generated by Claude Code
lydakis commentedon Oct 6, 2026
One more P2, from the Codex review of #35 at b872a8f:
admitThisDevicelists only that lease. If another ready lease ends in the same four characters, the returned peer is named with the ambiguous short suffix, anderrand peers --on <name>shows that unusable name. The fix is to name the peer against the full lease list. (cmd/errand/leases.go, admitThisDevice) Fixed in Check lease targets when acquire returns and reach leases by the client's key #46.Generated by Claude Code
lydakis commentedon Oct 6, 2026
Three more P2s, from the Codex review of #32 at fcf95d8:
where, the client's withdrawal no longer ends the lease, and each new run refreshes its idle window and is sent to the same machine. Only the lifetime limit orerrand leases releaseends it. The fix is to count the hand-out as use only once the client has checked the target, or to retire a ready lease whose hand-out fails that check. (internal/cloud/broker.go, share) Fixed in Keep cloud leases alive while in use and bound what the cloud peer keeps #45.AcquireLeaseruns out of retries on a transport error or a bad response, the cloud peer may already hold the request, but the client returns without withdrawing it. That holder is then released only by the idle or lifetime rule. (cmd/errand/leases.go, leaseRunner) Fixed in Settle ambiguous lease requests and keep showing launch progress #43.leaseaction before the retry, the 403 sends the client to another supplier while the first lease stays held. A 403 is safe to fall through only before any ambiguous attempt. (internal/client/leases.go) Fixed in Settle ambiguous lease requests and keep showing launch progress #43.Generated by Claude Code
lydakis commentedon Oct 6, 2026
Four more P2s, from the Codex review of #26 at 7a565c4 (its last commit before merge):
max_leases) untillambdaLaunchSettlepasses. The machine is already gone, so nothing is billed. (internal/cloud/lambda.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.userother thanubunturents a machine it can't log in to. Lambda images only haveubuntu, so the fix is to reject any other value, or drop the setting. (internal/config/cloud.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.errand_binarycan change between the check and the upload. The binary is validated before launch but reopened after, so a package update in between sends unchecked bytes to a machine that's already billing. The fix is to keep one open file, or a copy, from check to upload. (internal/cloud/lambda_install.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.internal/cloud/lambda_api.go) Fixed in Tighten Lambda release, install and secret checks, and rank free offers as priced #49.Generated by Claude Code
lydakis commentedon Oct 6, 2026
Two more, from the live Lambda run of #26 and a local run of the suite on main:
acquire_timeout.errand serve --state-dir cloud/state(or a relativestate_dir) is accepted, but the cloud peer's SSH identity then lives at a relative path, whichssh_pin.gorejects. In the live run the instance booted and errand installed, then the lease sat in "waiting for errand on the machine" withnot answering yet: SSH identity file "cloud/state/lambda/lambda_ed25519" must be an absolute path, billing until it was released by hand. The fix is to resolve the state directory to an absolute path at startup, or refuse a relative one. (cmd/errand/main.go, serve) Fixed in main (see below).go test -race -count=1 ./...on an M-series Mac failed ininternal/cloudon both of two runs:TestFailedLaunchesAreReleased(acquire did not finish within 200ms, the 200msAcquireTimeoutracing a shell script's startup) andTestReleaseRetriesUntilItSucceeds(stillreleasingafter a fixed 100ms sleep). Both pass alone (4/4) and passed in CI. The fix is to wait for the expected progress line instead of sleeping, and give the acquire timeout more headroom. (internal/cloud/broker_test.go) Fixed in Fix the cloud tests broken or flaky on main #41.Generated by Claude Code
lydakis commentedon Oct 6, 2026
On the two items above:
cloud.Newmakes the state directory absolute before any provider sees it (internal/cloud/broker.go:145), and the Lambda key directory is derived from it (internal/cloud/lambda.go:265). The live run that hit this was on an earlier build.internal/cloudpass.Generated by Claude Code
lydakis commentedon Oct 6, 2026
From #42 (Codex review of a8de1f3), P2:
#42 also makes these earlier items moot once it merges: the replay-time 403 after ready, holders retired between probes, and "every run gave it up". The "unusable ready lease renewed" item still applies.
Generated by Claude Code
lydakis commentedon Oct 6, 2026
Follow-ups from #47 (the Lambda catalog), noticed while verifying 4a3c7aa. Neither one rents anything:
max_price_per_hourare advertised like any other. As of 4a3c7aa the broker refuses them with the reason before launching, and placement only tries one when no cheaper offer matches. Until then, though,errand peersanderrand doctorlist them as leasable, and a run prints "leasing from " before the refusal. A possible fix is to carry the reason onproto.Offer, so the client skips those offers and explains them up front. That adds a field to the daemon API, so it needs George's OK.errand_binarylists every instance type. Each lease then fails before anything is rented. The same "unavailable, with a reason" field would show this in placement.Generated by Claude Code
lydakis commentedon Oct 6, 2026
Decided: no
unavailablefield on advertised offers. An offer that is overmax_price_per_hour(or has no errand build on a dev cloud peer) keeps failing at lease time with its reason, so the fix is to raise the limit. Dropped from the follow-up list.Generated by Claude Code