Skip to content

Don't write a beamignore all the time#46

Merged
cooper-grc merged 3 commits intobeam-cloud:mainfrom
jamie-retool:jd/dont-write-all-the-time
Mar 20, 2026
Merged

Don't write a beamignore all the time#46
cooper-grc merged 3 commits intobeam-cloud:mainfrom
jamie-retool:jd/dont-write-all-the-time

Conversation

@jamie-retool
Copy link
Copy Markdown
Contributor

@jamie-retool jamie-retool commented Mar 19, 2026

When using a known/static image ID, the SDK shouldn't attempt to write a .beamignore file to disk. The file sync path (and its .beamignore) is only relevant when building a new image from local files. Writing unconditionally breaks in read-only or restricted environments where no file sync is happening. This moves initIgnoreFile() so it only runs when no explicit ignore patterns are provided, like when a file sync is actually needed.

Additionally, when prepareRuntime did fail, it threw a generic "Failed to prepare runtime" with no indication of the actual cause (bad client, failed build, volume not ready, etc.) because stub.prepare() only returned false. Now each failure point stores the real error on stub.lastError, which gets surfaced in the exception, making failures diagnosable.


Summary by cubic

Stop writing .beamignore when a static image or explicit ignore patterns are used, and surface real errors from runtime preparation so failures are diagnosable.

  • Bug Fixes
    • Only create/read .beamignore when no ignore patterns are provided (i.e., when file sync is needed). Prevents failures in read‑only environments and with known image IDs.
    • Store errors on StubBuilder.lastError at each failure point and include the message in SandboxConnectionError. Makes build, sync, volume, and API errors visible.
    • Added tests to verify error surfacing for file sync and stub creation failures.

Written for commit 27747fb. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@jamie-retool jamie-retool changed the title Jd/dont write all the time Don't write a beamignore all the time Mar 20, 2026
@cooper-grc cooper-grc merged commit 4eff90e into beam-cloud:main Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants