René's URL Explorer Experiment


Title: fix(sandbox): keep reused E2B workbench leases within the runtime cap by waleedlatif1 · Pull Request #8758 · simstudioai/sim · GitHub

Open Graph Title: fix(sandbox): keep reused E2B workbench leases within the runtime cap by waleedlatif1 · Pull Request #8758 · simstudioai/sim

X Title: fix(sandbox): keep reused E2B workbench leases within the runtime cap by waleedlatif1 · Pull Request #8758 · simstudioai/sim

Description: Summary E2B kills a running sandbox 24h after it last started or resumed and silently clamps any longer timeout (persistence docs: pause + resume resets the count). findSessionSandbox recorded requestedAt + max(5min, endAt - now, lease) as the session deadline, so a workbench reconnected late in its life claimed a lease past the cap, outlives() skipped the extension, and E2B killed the workbench mid-run Every E2B handle now carries the cap (startedAt + 24h, or the connect time when resuming a paused workbench), and the session deadline is clamped to it in one place, covering both the reconnect and extendLifetime When a running workbench cannot fit the requested lease before its cap, it is paused (Sandbox.pause) and resumed through the existing Sandbox.connect, which restarts E2B's runtime count with files, packages and processes intact instead of replacing the workbench A pause failure is logged and the workbench is reused with an honest, capped deadline. A resume failure propagates like any other reconnect failure; the workbench stays paused and the next acquire resumes it, rather than creating a second workbench under the same session key Reaching the cap on a reconnected workbench is now classified as provider_limit instead of a user-code timeout (exit 124), since providerLimitAtMs was previously only set on a fresh create with exactly a 24h lifetime. A timeout counts as the cap only when the command's own deadline, measured from E2B dispatch, would have outlived it, so a short command timing out near the cap stays a user timeout Workbench file reads and upload snapshots pass their idle lease into the reconnect instead of extending afterwards, so they get the same reset Type of Change Bug fix Testing New E2B continuous-runtime cap cases in e2b-session.test.ts run against a fake control plane that clamps timeouts to the cap and restarts it on resume: capped deadline when pausing fails (including after extendLifetime), pause + resume when the lease cannot fit, and provider_limit at the cap. All three fail on the previous code; reverting each guard individually turns its test red Caller tests in session-files.test.ts / session-file-snapshot.test.ts that fail when the reconnect is not asked for the idle lease lib/execution/remote-sandbox/ + lib/mothership suites, bun run lint, bun run type-check, bun run check:audits, docs-manifest:check, block-registry check Root bun run test Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary E2B kills a running sandbox 24h after it last started or resumed and silently clamps any longer timeout (persistence docs: pause + resume resets the count). findSessionSandbox recorded req...

X Description: Summary E2B kills a running sandbox 24h after it last started or resumed and silently clamps any longer timeout (persistence docs: pause + resume resets the count). findSessionSandbox recorded req...

Opengraph URL: https://github.com/simstudioai/sim/pull/8758

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:60657cde-5d79-1286-6b83-ae487874a9c4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDC80:267719:C31A22:10B801C:6AFB5687
html-safe-nonce606d86a33f743a16879173a43e1234ed2aa703eef24d33c239a154e2cafb7bbc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzgwOjI2NzcxOTpDMzFBMjI6MTBCODAxQzo2QUZCNTY4NyIsInZpc2l0b3JfaWQiOiI2NDk5NzAzNTYzMTk5MDEzMTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac94aa28e3ff724ce9113ab51476855c66974839ed785ae79c9773306b63250f13
hovercard-subject-tagpull_request:4777777837
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8758/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary E2B kills a running sandbox 24h after it last started or resumed and silently clamps any longer timeout (persistence docs: pause + resume resets the count). findSessionSandbox recorded req...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8758/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8758%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8758%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/8758/files
Reloadhttps://github.com/simstudioai/sim/pull/8758/files
Reloadhttps://github.com/simstudioai/sim/pull/8758/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/e2b-session-lease-caphttps://github.com/simstudioai/sim/tree/fix/e2b-session-lease-cap
Conversation 22 https://github.com/simstudioai/sim/pull/8758
Commits 4 https://github.com/simstudioai/sim/pull/8758/commits
Checks 35 https://github.com/simstudioai/sim/pull/8758/checks
Files changed https://github.com/simstudioai/sim/pull/8758/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
fix(sandbox): keep reused E2B workbench leases within the runtime cap https://github.com/simstudioai/sim/pull/8758/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/8758/files
0449c6d fix(sandbox): keep reused E2B workbench leases within the runtime cap waleedlatif1 Oct 7, 2026 https://github.com/simstudioai/sim/pull/8758/commits/0449c6d60fa33abba1d4942b94f9e7764b3a2548
ea68ac9 fix(sandbox): attribute a timeout to the E2B cap only when the comman… waleedlatif1 Oct 7, 2026 https://github.com/simstudioai/sim/pull/8758/commits/ea68ac9a8c2b9f89f242ebf279f380c87d1e3644
c9d660c fix(sandbox): measure the command deadline from E2B dispatch waleedlatif1 Oct 7, 2026 https://github.com/simstudioai/sim/pull/8758/commits/c9d660ccaa8d81ad4ba1dfba7c660313887e9c55
7538285 fix(sandbox): let workbench file reads request their idle lease throu… waleedlatif1 Oct 7, 2026 https://github.com/simstudioai/sim/pull/8758/commits/7538285535b9ed4c0903d11bcd4734adb2e5c5e9
Clear filters https://github.com/simstudioai/sim/pull/8758/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
e2b-session.test.ts https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
e2b.ts https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
session-file-snapshot.test.ts https://github.com/simstudioai/sim/pull/8758/files#diff-5860fbd9b8dc6d4d48669bc9e726ef2d12283357134d9b3070e2343287e76b26
session-file-snapshot.ts https://github.com/simstudioai/sim/pull/8758/files#diff-1d8505e72603d78bef483580bfdd932396718fa19e8c39e88c8d9c45af6c944d
session-files.test.ts https://github.com/simstudioai/sim/pull/8758/files#diff-79d852d252fae092610013ee011a3980e2b403c382f003e3ad61b33d0406610b
session-files.ts https://github.com/simstudioai/sim/pull/8758/files#diff-9a58edebb7476c0907e884953d90bbe735865dd8fd9442c4b589804ec072ec35
apps/sim/lib/execution/remote-sandbox/e2b-session.test.tshttps://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
View file https://github.com/simstudioai/sim/blob/7538285535b9ed4c0903d11bcd4734adb2e5c5e9/apps/sim/lib/execution/remote-sandbox/e2b-session.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8758/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
https://github.com/simstudioai/sim/pull/8758/files#diff-3b81819062f839724f7a7e7103433cc0e7947cb627037cc397bdd9f44a90e015
apps/sim/lib/execution/remote-sandbox/e2b.tshttps://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
View file https://github.com/simstudioai/sim/blob/7538285535b9ed4c0903d11bcd4734adb2e5c5e9/apps/sim/lib/execution/remote-sandbox/e2b.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8758/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
https://github.com/simstudioai/sim/pull/8758/files#diff-f54663c69a136b10f426311853c9d3c7b9f328f0b85719ae7c23c0dd7030721d
apps/sim/lib/execution/remote-sandbox/session-file-snapshot.test.tshttps://github.com/simstudioai/sim/pull/8758/files#diff-5860fbd9b8dc6d4d48669bc9e726ef2d12283357134d9b3070e2343287e76b26
View file https://github.com/simstudioai/sim/blob/7538285535b9ed4c0903d11bcd4734adb2e5c5e9/apps/sim/lib/execution/remote-sandbox/session-file-snapshot.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8758/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8758/files#diff-5860fbd9b8dc6d4d48669bc9e726ef2d12283357134d9b3070e2343287e76b26
https://github.com/simstudioai/sim/pull/8758/files#diff-5860fbd9b8dc6d4d48669bc9e726ef2d12283357134d9b3070e2343287e76b26
apps/sim/lib/execution/remote-sandbox/session-file-snapshot.tshttps://github.com/simstudioai/sim/pull/8758/files#diff-1d8505e72603d78bef483580bfdd932396718fa19e8c39e88c8d9c45af6c944d
View file https://github.com/simstudioai/sim/blob/7538285535b9ed4c0903d11bcd4734adb2e5c5e9/apps/sim/lib/execution/remote-sandbox/session-file-snapshot.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8758/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8758/files#diff-1d8505e72603d78bef483580bfdd932396718fa19e8c39e88c8d9c45af6c944d
https://github.com/simstudioai/sim/pull/8758/files#diff-1d8505e72603d78bef483580bfdd932396718fa19e8c39e88c8d9c45af6c944d
https://github.com/simstudioai/sim/pull/8758/files#diff-1d8505e72603d78bef483580bfdd932396718fa19e8c39e88c8d9c45af6c944d
apps/sim/lib/execution/remote-sandbox/session-files.test.tshttps://github.com/simstudioai/sim/pull/8758/files#diff-79d852d252fae092610013ee011a3980e2b403c382f003e3ad61b33d0406610b
View file https://github.com/simstudioai/sim/blob/7538285535b9ed4c0903d11bcd4734adb2e5c5e9/apps/sim/lib/execution/remote-sandbox/session-files.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8758/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8758/files#diff-79d852d252fae092610013ee011a3980e2b403c382f003e3ad61b33d0406610b
https://github.com/simstudioai/sim/pull/8758/files#diff-79d852d252fae092610013ee011a3980e2b403c382f003e3ad61b33d0406610b
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8758/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.