Skip to content

Add the built-in Lambda provider (experimental) - #26

Merged
lydakis merged 52 commits into
mainfrom
claude/errand-cloud-30mg5f
Oct 6, 2026
Merged

lydakis merged 52 commits into
mainfrom
claude/errand-cloud-30mg5f

Conversation

@lydakis

@lydakis lydakis commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Before: a cloud peer (from #32) can lease machines only through provider commands you write yourself.

After: a cloud peer can lease Lambda GPU instances directly. You put a Lambda API key in a file, list the instance types you want in the cloud peer's config, and errand run --where gpu=h100 ... launches one, runs the job on it, and terminates it once it has been idle. The provider is marked experimental.

This is the last of three stacked PRs split out of the original cloud change: #31 adds GPU --where terms, #32 adds the lease broker, command provider, CLI and daemon endpoints, and this one adds Lambda on top. Review and merge them in that order.

How: internal/cloud/lambda.go implements the provider against Lambda's public API: launch with a per-lease SSH key, wait for an IP, install and start errand over SSH, and terminate, then wait until Lambda lists the instance as terminated before the lease is recorded as released. The API key is read from a file and never logged; errors about it name the file by what it holds, not its path. Config gains a lambda provider with offers by instance type and region.

Tested for real on 2026-10-05: an A10 in us-east-1 was ready in 5m27s (mostly Lambda boot), nvidia-smi ran, a second job reused the same lease, and errand leases rm waited for Lambda to report the instance terminated. No instances were left behind.

Deferred findings from review are tracked in #33.

🤖 Generated with Claude Code

https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6

A cloud peer is an errand daemon with machine offers. When no runner you
own matches --where (new terms: gpu, gpus>=N, gpu=MODEL, vram>=N), it
leases a machine, the machine joins as a runner, and the job runs there.
Leases end on idle, at a max lifetime, or with `errand leases rm`, and
survive restarts. Providers are two commands (acquire, release) or the
built-in Lambda Cloud provider, which installs errand over SSH and never
leaves an instance billing after a crash.

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 5, 2026 02:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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:31:05.990470Z 7a565c4 New commits
🔒 Security Review ✅ Completed 2026-10-06T00:30:13.193550Z 7a565c4 New commits

Security findings

Advisory findings (3)

ℹ️ 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: 98f644ddfc

ℹ️ 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
Comment thread internal/daemon/server.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread internal/daemon/gpus.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread cmd/errand/doctor.go Resolved
- Ctrl-C during the lease request no longer drops the lease: the request
  finishes, and the launching lease it names is released.
- A launch is canceled at the offer's max_lifetime, not only at
  acquire_timeout.
- A lease is ready only once that is recorded; a failed write releases it
  instead of leaving a record a restart would release under a job.
- The running broker forgets leases that ended over a week ago, as
  startup already did.
- Offers are shown only to callers that may see their lease IDs, so a
  caller without the lease action never forgets live lease peers.
- doctor still runs its automatic-apply checks when a run would lease.
- GPU facts refresh in the background, so a hung nvidia-smi cannot push
  /v0/info past the client's placement deadline.

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

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

All seven findings are fixed in d4ef04a, each with a test that fails without its fix.


Generated by Claude Code

@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: d4ef04a8d9

ℹ️ 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 cmd/errand/placement.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread cmd/errand/placement.go Resolved
Comment thread docs/cloud/static-pool.sh Resolved

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: d4ef04a8d9

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread cmd/errand/placement.go Resolved
Comment thread internal/daemon/leases_http.go Resolved
Without tailscale_auth_key_file, a leased Lambda machine runs its runner
with transport = "ssh": no network port, and jobs reach it over SSH on
port 22 like any SSH peer. Clients' public keys come from the offer's
authorized_keys. The lease carries the host key the machine booted with,
and errand pins it for that target, so no known_hosts entry or prompt is
needed and a reused IP cannot impersonate the machine. The cloud peer
watches the runner with the key it installed it with.

Command providers can return the same host_key with an ssh target.

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

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

d1cdc9b makes Tailscale optional for Lambda: without an auth key, the runner listens only for SSH, and the host key from launch is pinned on the client.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d1cdc9b768

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: d1cdc9b768

ℹ️ 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/lambda_install.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread internal/config/cloud.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread internal/client/ssh.go Resolved
- A workspace's own run.where never rents a machine; personal defaults,
  profiles and --where can.
- Lease requests must be application/json without an Origin header, so a
  web page cannot start a billable machine.
- A run rents a machine only after its local preparation (forwards,
  snapshot) succeeds.
- Placement drops ended lease peers and runs again, even when the machine
  still answers.
- Releases are acknowledged only once recorded.
- The reaper checks max lifetime before probing and probes ready leases
  concurrently.
- static-pool.sh claims a slot and records its lease in one atomic step.

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

@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: 2054264850

ℹ️ 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 cmd/errand/workspaces.go Resolved
Comment thread internal/cloud/broker.go Resolved
Comment thread internal/cloud/provider.go Resolved
Comment thread cmd/errand/leases.go Resolved
The cloud peer makes its own SSH key on first use, adds it to the Lambda
account, and installs and watches machines with it, so ssh_key_name and
ssh_private_key_file are gone. Each client makes an errand SSH key of its
own and sends the public half with the lease request; the machine admits
only that key, so authorized_keys is gone too. A lease is reused only for
the same client key. Command providers get the key as ERRAND_LEASE_SSH_KEY.

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

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Since your last review: 2054264 fixes round 2. d9629e0 makes the Lambda SSH path need only the API key: the cloud peer makes and registers its own SSH key, and each client sends its own key with the lease request.


Generated by Claude Code

- Tailnet leases run Tailscale-only, so no SSH key reaches their runner.
- A runner with active leases refuses to start without its [cloud] section,
  and a command offer's leases are bound to its exact commands.
- Host key pins live in the state directory and are written before the
  lease is recorded; pinned connections get their own control path.
- The idle check records a release before destroying the machine.
- Lease records keep their cloud peer's entry, so release works after the
  name changes.
- workspaces create rents only after its snapshot is prepared.
- Provider stderr is drained past an over-long line.

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

@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: d9629e0df2

ℹ️ 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
Comment thread cmd/errand/leases.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread docs/cloud/static-pool.sh Resolved

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

The failing github-advanced-security check isn't from this PR. Its log ends with Copilot's 402 You have exceeded your monthly quota before any analysis runs, and it fails the same way on every push. This session can't re-run it, since that has returned 403 before. CodeQL, GitGuardian and the Linux, macOS and Windows checks pass.

Next on this PR: the cloud lease code is being restructured so that recurring review findings are fixed at their cause. One persisted state machine in the broker, and no lease state kept on the client.


Generated by Claude Code

@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: 6ef4e6c5ae

ℹ️ 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/config/cloud.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread internal/cloud/lambda.go Resolved
Comment thread internal/cloud/provider.go Resolved
The cloud peer now drives each lease with one worker goroutine that makes
every provider call. Every change goes through one update that writes the
whole record before readers see it, and only moves leases forward. A lease
records how to release itself (release command or Lambda API key file),
its idle timeout and the key the cloud peer probes it with, so changing or
removing offers or the whole [cloud] section only stops new leases. Every
runner now has a broker; the refuse-to-start checks are gone. A restart
still releases interrupted launches.

Clients keep no lease records, pin files or peer aliases. /v0/info lists
the caller's active leases with their targets, host keys and admitted SSH
key; placement, ps, peers and lease peer names (cloud-7f3a, any
unambiguous ending of the lease ID) all come from that list, and host
keys are trusted in memory for the process. Lease requests carry a
request ID, so a client that lost the answer gets the same lease again.

Release cancels a running acquire or probe. Leases reached over the
tailnet are reused across a user's machines; SSH ones only by the machine
whose key they admit. Offer gpus is capped at 64 and acquire stdout at
16 KiB, which keeps release's state within Windows' environment limit.

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

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

The lease code was rebuilt in adf4d3a: the cloud peer is now the only lease record (one worker per lease, every change validated and persisted before it is visible), and the client keeps no lease state. Earlier threads are answered and resolved.


Generated by Claude Code

@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: adf4d3a809

ℹ️ 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/config/cloud.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread cmd/errand/leases.go Resolved
Comment thread internal/client/ssh_key.go Resolved

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: adf4d3a809

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread internal/daemon/server.go Resolved
…lease

Ctrl-C before the job starts now withdraws the run's lease request. The
cloud peer ends the lease only if that request made it and no other request
was handed it; a ready lease is released at its next check unless a job is
running on it. This replaces the client deciding from the lease state.

Also: a cloud peer without offers keeps leftover [cloud] settings and stays
listed by errand leases while it holds leases, and the client SSH key is
placed private half first, with a missing public half derived again.

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

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

1c81364 answers the five findings on adf4d3a. On Ctrl-C the run now withdraws its request, and the cloud peer decides whether the lease ends (not if another request shares it, or a job is running on it). Cloud peers whose offers were removed stay listed and keep their settings, and the client SSH key creation recovers from a missing public half.


Generated by Claude Code

@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: 1c813641f6

ℹ️ 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
Comment thread cmd/errand/leases.go Resolved
claude added 2 commits October 5, 2026 04:28
… terminated

A leased machine admits its owner for every action, so holding a lease
needs submit on the cloud peer. A caller without it is no longer shown
lease targets, and its leases end when it next asks about them.

Lambda release now counts only once Lambda's instance list shows every
instance of the lease terminated (or gone). Release returns ReleasePending
while termination is under way, and the broker asks again shortly.

Docs say the idle and lifetime limits hold only while the cloud peer runs
and are not a spending cap.

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

A lease now records each request it was handed. An interrupted run
withdraws its own request, and the lease ends only once no request still
holds it; a job seen running, or more than 32 requests, leaves it to the
idle rule. A withdrawal the cloud peer no longer ties to a lease is
reported as kept rather than as a failure.

errand leases also asks the implicit local peer, which placement can rent
from.

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 5, 2026 06:41
claude added 2 commits October 5, 2026 06:44
…eases

# Conflicts:
#	cmd/errand/peers_render.go
#	docs/CONFIGURATION.md
#	internal/daemon/server.go
#	internal/placement/requirements.go
#	internal/placement/requirements_test.go

lydakis commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 09c954122d

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 09c954122d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

claude added 3 commits October 5, 2026 23:03
A buffer that limits what it keeps by overriding Write while embedding
bytes.Buffer also exposes Buffer.ReadFrom. exec.Cmd copies a child's
output with io.Copy, which prefers ReadFrom, so the limit never applied:
git merge-file's stderr was kept in full. internal/limitbuf wraps the
buffer instead, and merge uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
limitedBuffer embedded bytes.Buffer, so exec copied acquire's stdout and
release's output through Buffer.ReadFrom and never hit the limit: an
acquire that printed more than 16 KiB was accepted and kept in memory in
full. The provider now uses limitbuf.Buffer, which is also on its way to
main for the same bug in merge.

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

The leases branch replaced limitedBuffer with limitbuf.Buffer, whose
limit holds when exec copies a child's output; the Lambda installer's
ssh output now uses it too.

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

@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: c56fac0b88

ℹ️ 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/lambda.go Resolved
claude added 10 commits October 5, 2026 23:17
A caller that keeps the lease action but loses submit has its leases
ended, and list and get already hid their targets from it. Release
returned the raw lease, so its target leaked. Every response that
carries one lease now goes through leaseView.

Also covers a child of the acquire command that keeps stderr open: a
release still goes ahead once the command is stopped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
--where turned a ready lease the cloud peer listed into an ordinary
candidate and ran on it directly. Nothing then held the lease for the
run, so it could go idle and be released while the run was still
preparing (lease guarantee 5). A ready lease is no longer a placement
candidate: the run asks the cloud peer, whose Acquire already hands a
matching ready lease to the request as a holder and starts a full idle
window.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
A caller with lease but not submit was shown its leases without their
targets, but the progress and error lines still carried the provider's
output, and a pool provider prints the URL it claimed. Those callers
now see neither.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
Since 307e8df every --where run that reuses a ready lease is handed it
by the cloud peer, and each hand-out added a holder. A run whose job
started and ended between two idle checks never withdraws, so holders
piled up until the 32-holder bound turned later runs away. Handing out
a ready lease now counts as use, as a job seen on the machine does:
holders stop mattering and only the idle and lifetime rules end it. The
latest run is kept as the one holder, so its retry and withdrawal still
find the lease.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
The release script returns at once, so by the time info answers the lease
can already be released and is no longer listed. What the test checks is
that no listed lease shows its target.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BQxiCNDXMnjv5pvmgo5E6
@lydakis
lydakis changed the base branch from claude/errand-cloud-leases to main October 6, 2026 00:21
@lydakis
lydakis merged commit 39c7d39 into main Oct 6, 2026
7 of 8 checks passed
@lydakis
lydakis deleted the claude/errand-cloud-30mg5f branch October 6, 2026 00:24

@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: 7a565c4275

ℹ️ 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/lambda.go Resolved
Comment thread internal/config/cloud.go Resolved
Comment thread internal/cloud/lambda_install.go Resolved
Comment thread internal/cloud/lambda_api.go Resolved
lydakis added a commit that referenced this pull request Oct 6, 2026
* Give the Lambda broker test a way to admit SSH keys

#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

* Wait for the broker instead of sleeping in two lease tests

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

---------

Co-authored-by: Claude <[email protected]>
lydakis added a commit that referenced this pull request Oct 6, 2026
* Give the Lambda broker test a way to admit SSH keys

#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

* Give the Lambda broker test a way to admit SSH keys

#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

* End ready leases only by the idle and lifetime rules

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

* Wait for the broker instead of sleeping in two lease tests

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

---------

Co-authored-by: Claude <[email protected]>
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.

3 participants