René's URL Explorer Experiment


Title: fix(sandbox): charge each file ceiling once per execution, not once per source by icecrasher321 · Pull Request #7288 · simstudioai/sim · GitHub

Open Graph Title: fix(sandbox): charge each file ceiling once per execution, not once per source by icecrasher321 · Pull Request #7288 · simstudioai/sim

X Title: fix(sandbox): charge each file ceiling once per execution, not once per source by icecrasher321 · Pull Request #7288 · simstudioai/sim

Description: Two ceilings on a Function run's sandbox files were charged per source rather than per execution. Both came out of review comments on #7251; the behavior is real in each case, though not for the reason the comments gave. Mounts — a storage key mounts once planUserFileMounts assigned a path per array element, so one storage key named by two sources became two mounts. The comment pointed at collectSandboxFileMountRefs appending a file once per marker position. That half was already handled upstream — resolveSandboxFilePathReference reuses the marker standing for a given file.key, so twice in one block yields one marker. And the stated consequence, "the key-based path map makes every reference use the last mount", is harmless on its own: both mounts hold identical bytes. What is actually reachable is the other input to the same list. mountedUserFiles comes from the files param, which is visibility: 'user-or-llm' and deduped nowhere. A model repeating a file id, or passing a file the code also references with , produces a real duplicate — costing a presign, a second transfer of identical bytes, and a second charge against both the mount byte budget and MAX_BLOCK_MOUNTED_FILES, either of which then refuses a request that fits. So the fix goes at planUserFileMounts rather than in the collector: it is the one place the whole mount set is assembled, so it covers the explicit list, the markers, and the overlap between them in a single pass. Keyed on the storage key, since that is the object's identity and already what mountPathsByKey looks paths up by. First occurrence wins, so the name listed first is the one the code sees. No keyless branch: userFileSchema declares key: z.string().min(1), and the resolver drops a file without a key before it can become a marker, so there is no empty-key case to carry. This only ever removes work. Fewer files reach MAX_BLOCK_MOUNTED_FILES and the byte budget, so it cannot newly refuse anything; the surviving mount is the first rather than the last, which is the un-suffixed name. Exports — one 20-file ceiling per run, not per source MAX_SANDBOX_OUTPUT_FILES is documented as how many files one execution may export "whether declared by path or discovered by harvesting the output directory". collectExportedFiles already runs the byte ceiling that way — one running total across both, with a declared path inside the harvest directory dropped from the discovered set rather than billed twice. The count ceiling did not follow: listOutputDirectoryFiles checked the harvest alone, so a request could export 20 declared plus 20 discovered. Declared and discovered are now counted together, and the declared-path filter moved into the listing so count and bytes apply the same rule. Scope of the behavior change: execute-request sets outputSandboxDir only when no output declares a sandboxPath, so on every call it makes, declaredPaths is empty — the comparison and the error message are exactly what they are today. The copilot doc tools never set the directory at all. The combination is admissible through the contract (outputs.files alongside the legacy top-level outputSandboxPath), which is what makes this worth closing rather than leaving to the next caller, but nothing on a normal path changes. The naive form of this fix would over-refuse: a run whose 20 harvested files include the one declared path would count as 21. A test pins that case. Tests planUserFileMounts: one storage key mounts once across sources. Conformance (both providers): a run that declares and harvests spends one ceiling; a declared path inside the harvest directory is not charged twice. Fixture keys in sandbox-mounts.test.ts were identical across files the tests meant to be distinct — the collision-suffix and inline-budget tests both passed only because their fixtures shared one key. They now differ, which is what those tests always claimed to set up. bun run test (function-execution, remote-sandbox, executor/variables): 823 passed, 40 skipped. bunx turbo run type-check: 26/26. bun run check:api-validation clean. 🤖 Generated with Claude Code

Open Graph Description: Two ceilings on a Function run's sandbox files were charged per source rather than per execution. Both came out of review comments on #7251; the behavior is real in each case, though not for th...

X Description: Two ceilings on a Function run's sandbox files were charged per source rather than per execution. Both came out of review comments on #7251; the behavior is real in each case, though not fo...

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

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:ab04028e-6481-33f9-de1f-837239e4521a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDD36:3D53D8:20BB28:2D830E:6AFB303C
html-safe-noncee0c707c570739e64f9e471d0e8f67a3f171de9023765dece07c8f2cf49250040
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDM2OjNENTNEODoyMEJCMjg6MkQ4MzBFOjZBRkIzMDNDIiwidmlzaXRvcl9pZCI6IjcwMzc4MzkwMjE5NzEyODgxMjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9063021ae1fc06d18d478482c85fd7fc8dd17961d7dc8a816e463102b44af532
hovercard-subject-tagpull_request:4397553528
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/7288/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altTwo ceilings on a Function run's sandbox files were charged per source rather than per execution. Both came out of review comments on #7251; the behavior is real in each case, though not for th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneefe184de15c1d8c1107a340cfc27bf7187b458dc07687ee1fa51f035148fb3d1
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
releasef567cf3af46b50a3211fb5dab569a9d6a7b58025
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7288/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7288%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%2F7288%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/7288/files
Reloadhttps://github.com/simstudioai/sim/pull/7288/files
Reloadhttps://github.com/simstudioai/sim/pull/7288/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)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
icecrasher321https://github.com/icecrasher321
staginghttps://github.com/simstudioai/sim/tree/staging
fix/sandbox-mount-and-export-ceilingshttps://github.com/simstudioai/sim/tree/fix/sandbox-mount-and-export-ceilings
Conversation 17 https://github.com/simstudioai/sim/pull/7288
Commits 1 https://github.com/simstudioai/sim/pull/7288/commits
Checks 28 https://github.com/simstudioai/sim/pull/7288/checks
Files changed https://github.com/simstudioai/sim/pull/7288/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
fix(sandbox): charge each file ceiling once per execution, not once per source https://github.com/simstudioai/sim/pull/7288/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/7288/files
2f3b704 fix(sandbox): spend each file ceiling once across every source Aug 30, 2026 https://github.com/simstudioai/sim/pull/7288/commits/2f3b704b908d92b6e71092e69eaceed20f34d2f5
Clear filters https://github.com/simstudioai/sim/pull/7288/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
resolver.ts https://github.com/simstudioai/sim/pull/7288/files#diff-689d75b70daf1f65a0914798bb39ad228e6918dc990978d09a349acfe0ca22f6
conformance.test.ts https://github.com/simstudioai/sim/pull/7288/files#diff-0e1ab8b63cac6249e7566a904ade332dbaef7ee062e7514c4b7e1676ab5f4309
index.ts https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
sandbox-mounts.test.ts https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
sandbox-mounts.ts https://github.com/simstudioai/sim/pull/7288/files#diff-d4966dfed5b71d1bfa6aed91eaf37c01045ea0b83afc8a7bc63d2a4b116af9ae
apps/sim/executor/variables/resolver.tshttps://github.com/simstudioai/sim/pull/7288/files#diff-689d75b70daf1f65a0914798bb39ad228e6918dc990978d09a349acfe0ca22f6
View file https://github.com/simstudioai/sim/blob/2f3b704b908d92b6e71092e69eaceed20f34d2f5/apps/sim/executor/variables/resolver.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7288/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7288/files#diff-689d75b70daf1f65a0914798bb39ad228e6918dc990978d09a349acfe0ca22f6
https://github.com/simstudioai/sim/pull/7288/files#diff-689d75b70daf1f65a0914798bb39ad228e6918dc990978d09a349acfe0ca22f6
apps/sim/lib/execution/remote-sandbox/conformance.test.tshttps://github.com/simstudioai/sim/pull/7288/files#diff-0e1ab8b63cac6249e7566a904ade332dbaef7ee062e7514c4b7e1676ab5f4309
View file https://github.com/simstudioai/sim/blob/2f3b704b908d92b6e71092e69eaceed20f34d2f5/apps/sim/lib/execution/remote-sandbox/conformance.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7288/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7288/files#diff-0e1ab8b63cac6249e7566a904ade332dbaef7ee062e7514c4b7e1676ab5f4309
https://github.com/simstudioai/sim/pull/7288/files#diff-0e1ab8b63cac6249e7566a904ade332dbaef7ee062e7514c4b7e1676ab5f4309
apps/sim/lib/execution/remote-sandbox/index.tshttps://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
View file https://github.com/simstudioai/sim/blob/2f3b704b908d92b6e71092e69eaceed20f34d2f5/apps/sim/lib/execution/remote-sandbox/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7288/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/files
https://github.com/simstudioai/sim/pull/7288/files#diff-45bb4d66958fbda0e750b34264c092e3ed4f472e7bff507cee5875a58b2d3ef4
apps/sim/lib/function-execution/sandbox-mounts.test.tshttps://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
View file https://github.com/simstudioai/sim/blob/2f3b704b908d92b6e71092e69eaceed20f34d2f5/apps/sim/lib/function-execution/sandbox-mounts.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7288/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
https://github.com/simstudioai/sim/pull/7288/files#diff-fb0fa6916ded9a2aedc882397795a783580ca73ad0e10b2c3ce6dd9d68e4863d
apps/sim/lib/function-execution/sandbox-mounts.tshttps://github.com/simstudioai/sim/pull/7288/files#diff-d4966dfed5b71d1bfa6aed91eaf37c01045ea0b83afc8a7bc63d2a4b116af9ae
View file https://github.com/simstudioai/sim/blob/2f3b704b908d92b6e71092e69eaceed20f34d2f5/apps/sim/lib/function-execution/sandbox-mounts.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7288/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7288/files#diff-d4966dfed5b71d1bfa6aed91eaf37c01045ea0b83afc8a7bc63d2a4b116af9ae
https://github.com/simstudioai/sim/pull/7288/files#diff-d4966dfed5b71d1bfa6aed91eaf37c01045ea0b83afc8a7bc63d2a4b116af9ae
Please reload this pagehttps://github.com/simstudioai/sim/pull/7288/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.