Uh oh!
There was an error while loading. Please reload this page.
Add instance expiration controls - #434
Conversation
-->
✱ stlc build✅ gocode · compare
✅ pythoncode · compare
✅ typescriptcode · compare
Diagnostics: ❗ 0 new / 1 total error, 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 843a3cd. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
843a3cd to
469a295Compare469a295 to
0336f8bComparechruffins
commented
Aug 20, 2026
reviewed — one correctness issue and three follow-ups worth addressing. Bugs
Structural / Maintainability
Questions
|
sjmiller609
commented
Aug 21, 2026
|

Summary
ttlor absoluteexpires_atwhen creating or updating an instancettl: "0s"to disable expirationexpires_atdeadline, returningnullwhen disabled409 instance_expiredonce the current deadline has passed and404if deletion already completedInstances without an expiration are unchanged. The reaper uses the normal instance deletion path.
Testing
go test ./... -run '^$'make oapi-generate(verified deterministic output)The complete API suite was also attempted, but environment-dependent tests require
mkfs.erofsand network bridge permissions unavailable locally. The targeted tests and repository-wide compile pass.Note
Medium Risk
Introduces automatic instance deletion and new create/update locking around expiration, which can destroy running workloads if deadlines are set incorrectly. Race handling between updates and the reaper is security-adjacent for data loss but is opt-in and covered by tests.
Overview
Adds optional instance expiration on create and update: callers may set a relative
ttl(Go duration) or an absoluteexpires_at, but not both.ttl: "0s"disables expiration. Responses always include canonicalexpires_at(nullwhen disabled).A background TTL reaper starts at process init, sweeps immediately, then every minute. It deletes expired instances through the normal delete path, skips busy lifecycle locks, rechecks the deadline under lock, and times out stuck deletes at 30s so the sweep can continue.
Update TTLs are resolved at commit time. Once the current deadline has passed, expiration updates return
409 instance_expired. Forks and snapshots drop expiration; restoring a snapshot keeps the live instance’s existing deadline.Reviewed by Cursor Bugbot for commit 127bc50. Bugbot is set up for automated code reviews on this repo. Configure here.