Open the e2b metrics window at sandbox creation, not a 1h span - #87
Open
gjjkbssg wants to merge 1 commit into
Open
Open the e2b metrics window at sandbox creation, not a 1h span#87gjjkbssg wants to merge 1 commit into
gjjkbssg wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #84
The official E2B JavaScript and Python SDKs document an omitted metrics
startas "defaults to the start of the sandbox". The compatibility route instead ran the sharedresolveWindowwith the native verb's one-hour default span, so an unqualifiedgetMetrics()silently dropped every retained sample older than one hour.Change: when
startis absent, the e2b route passes the ledger'srow.createdAtas the window start. Explicitstart/endbehavior, the native history verbs, and the live-reading fallback are unchanged (the fallback still only fires for windows that reach "now", which the creation-anchored default satisfies). The span argument stays because the resolver requires one and the native faces still mean it — noted in a comment at the call site.Test: regression in
compat.test.tsmirroring the issue's reproduction — a sandbox created two hours ago (column backdated directly; createdAt is immutable through the ledger) with retained samples at -90m and -10m; the unqualified call and an explicitstart=<createdAt>call both return both samples. Verified the test fails against unmodifiedmainand passes with the fix.Verification:
pnpm --filter @dormice/server test644/644, typecheck clean, biome clean on the touched files, and the e2e e2b suite green against the fake executor via the officiale2bSDK.