Skip to content

An open-source, faster Devin alternative

TypeScript

adjust

Brian Reardona3a8b96ba3f2
diff --git a/benchmarks/tti/_ledger_sdk.mjs b/benchmarks/tti/_ledger_sdk.mjs
index 12e09c17..40f0b21d 100644
--- a/benchmarks/tti/_ledger_sdk.mjs
+++ b/benchmarks/tti/_ledger_sdk.mjs
@@ -89,7 +89,12 @@ async function one(i) {
t.tti = performance.now() - s;
} catch (err) { t.err = String(err).slice(0, 90); }
iters.push(t);
- try { if (sb) await sb.destroy(); } catch {}
+ // kill(), NOT destroy() — the SDK has no destroy method, so this line used to
+ // throw into the swallowing catch below and leak EVERY sandbox the run made.
+ // 100 boxes per burst, silently, while the run reported success. Log failures
+ // rather than swallowing them: a teardown that fails quietly is how a
+ // benchmark ends up measuring a fleet 2x over its own box ceiling.
+ try { if (sb) await sb.kill(); } catch (e) { console.error("LEAK: kill failed for", t.i, String(e).slice(0, 80)); }
}
// Let the SDK's import-time connection prewarm finish so it is not racing the
diff --git a/internal/api/microvm_backend.go b/internal/api/microvm_backend.go
index 3f6cbdd8..5ebc3e6e 100644
--- a/internal/api/microvm_backend.go
+++ b/internal/api/microvm_backend.go
@@ -242,9 +242,15 @@ func newMicrovmClient(ctx context.Context) (*awsvm.Client, error) {
autoResume := os.Getenv("OPENSANDBOX_MICROVM_AUTO_RESUME") != "0"
sizeImages := parseSizeImages(os.Getenv("OPENSANDBOX_MICROVM_SIZE_IMAGES"))
defaultMemoryMB := envInt("OPENSANDBOX_MICROVM_DEFAULT_MEMORY_MB", 0)
+ // Empty pins nothing and takes the image's latest active version, which is
+ // what production wants. Setting it is for A/B: a republished image changes
+ // every box in the fleet at once, so without a way to pin an older version
+ // there is no way to tell "the image regressed" from "something else did".
+ imageVersion := os.Getenv("OPENSANDBOX_MICROVM_IMAGE_VERSION")
client := awsvm.NewClient(awsCfg, awsvm.Config{
Region: region,
ImageIdentifier: image,
+ ImageVersion: imageVersion,
DefaultMemoryMB: defaultMemoryMB,
SizeImages: sizeImages,
ExecutionRoleArn: os.Getenv("OPENSANDBOX_MICROVM_EXECUTION_ROLE_ARN"),
@@ -258,6 +264,9 @@ func newMicrovmClient(ctx context.Context) (*awsvm.Client, error) {
}
log.Printf("microvm: idle policy — suspend after %ds idle, terminate after %ds suspended, auto-resume=%v",
idleSec, suspendedSec, autoResume)
+ if imageVersion != "" {
+ log.Printf("microvm: image version PINNED to %s (unset OPENSANDBOX_MICROVM_IMAGE_VERSION for latest)", imageVersion)
+ }
return client, nil
}