feat: Standardize on TOGETHER_* environment variables and default machine config#74
Open
christianalfoni wants to merge 2 commits intomainfrom
Open
feat: Standardize on TOGETHER_* environment variables and default machine config#74christianalfoni wants to merge 2 commits intomainfrom
christianalfoni wants to merge 2 commits intomainfrom
Conversation
mohamedveron
requested changes
May 8, 2026
mohamedveron
approved these changes
May 8, 2026
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.
Standardize on
TOGETHER_*environment variablesDrop the legacy
CSB_*aliases everywhere and read onlyTOGETHER_*env vars across the SDKs, CLI, e2e tests, and CI workflow.❌ Current behavior
✅ New behavior
Repo-wide
grep CSB_now returns zero matches.🤔 Assumptions
secrets.TOGETHER_API_KEYwill be added to the GitHub repo's Actions secrets before this PR is merged — the e2e workflow will fail with an empty key otherwise.CODESANDBOX_SENTRY_ENABLEDwas previously documented but unreferenced in code; dropped from docs rather than renamed.🧠 Decisions
CSB_API_KEYas a fallback — callers using it will hit the "TOGETHER_API_KEY env var must be set" error. Acceptable because there is no public release usingCSB_*yet.CSB_SNAPSHOT_ID→TOGETHER_SNAPSHOT_ID(kept the prefix for symmetry rather than dropping it to bareSNAPSHOT_ID).utils/constants.ts,utils/api.ts). The CLI usesTogetherSandboxfrom the SDK directly now, so the conventions section was misleading.together-sandbox-cli/src/utils/api.ts— it importedgetInferredBaseUrlfrom./constants.js(file does not exist) and was unused by any command. Pure dead code.🔄 Discussions
CSB-1419brought in a newtests/e2e/directory and.github/workflows/e2e.ymlthat referencedCSB_*everywhere. Plan was extended to migrate those too rather than leaving the workflow broken.CreateSandboxParamsfromtogether_sandbox— but that symbol isn't exported. Switched the tests to plain kwargs (sdk.sandboxes.create(snapshot_id=...)) which also fits the Python SDK's actual API.🧪 Testing
grep CSB_andgrep CODESANDBOXreturn zero matches.CLAUDE.md,together-sandbox-python/README.md, andtests/e2e/test_snapshots.pyresolved manually.📁 References
Make sandbox resource allocation optional with sensible defaults
Calling
sdk.sandboxes.create()no longer requires the caller to specifymillicpu,memory_bytes, anddisk_bytes. Common cases collapse from a 5-line config object to a one-liner.❌ Current behavior
✅ New behavior
🤔 Assumptions
Snapshots.tsmemory-snapshot path was already hardcoding (cpuCount=1,memoryMb=2048,storageMb=10240). That was the de-facto sizing for "create a sandbox without thinking about it."1000millicpu satisfies the API constraint (≥ 250, multiple of 250).🧠 Decisions
??not||in TS so a caller who explicitly passes0reaches the API (and gets the proper validation error) instead of being silently rewritten.Sandboxes.tsexportsDEFAULT_MILLICPU/DEFAULT_MEMORY_BYTES/DEFAULT_DISK_BYTESbecauseSnapshots.tsreuses them directly (it calls the generatedapi.createSandbox, bypassing the facade). Python has no equivalent cross-module use, so the constants stay internal.create()keeps its kwarg-only signature (*separator preserved) — only the defaults changed.cpuCount/memoryMb/storageMbvariables. Smaller diff than restructuring the namespace dependency graph.🧪 Testing
tsc --noEmit, Python signature change is mechanical).together-sandbox-python/tests/test_facade.py). Recommend adding a test that verifiessandboxes.create(snapshot_id=...)with no resource args calls the underlying client withmillicpu=1000,memory_bytes=2 GiB,disk_bytes=10 GiB.snapshot_id,memory_bytes) — corrected to camelCase to match the actual SDK surface.CreateSandboxBodyfrom a generated-client internal module — replaced with the public kwarg form.📁 References