fix(daemon): start a lease's TTL when its allocation completes
Merged
AM
2mo ago+156+156+012345678901234567890123456789-10-10-01234567890123456789
Summary
Split out of #3118. This change affects every provider.
leases.allocate used to start the lease TTL when allocation began. A hosted provider can spend 30โ80 s creating its session, so a 60 s lease could expire before the caller got it. The TTL now starts when allocation completes. Two cases are unchanged:
- If the requester cancels, the lease is not renewed.
- If allocation fails, the lease is released as before.
A lease allocated without a provider keeps the TTL it was created with. It no longer holds a work pass, which used to renew it on release.
ADR 0007 and remote-proxy.md are updated to match.
Validation
pnpm check:affected --runpasses.- New tests cover:
- an allocation that outlasts the TTL;
- a lease without a provider keeping its original TTL;
- artifacts after a slow allocation and after a cancelled one.
๐ค Generated with Claude Code