docs(sandbox): document tembo.nix loading, project caching, and troubleshooting - #710
Open
tembo[bot] wants to merge 1 commit into
Open
docs(sandbox): document tembo.nix loading, project caching, and troubleshooting#710tembo[bot] wants to merge 1 commit into
tembo[bot] wants to merge 1 commit into
Conversation
tembo
Bot
requested review from
Coleary005,
DarrenBaldwin07 and
benja
as code owners
August 21, 2026 08:14
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
Author
|
Requesting review from @DarrenBaldwin07 who has experience with the following files modified in this PR:
|
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.
Summary
Documents how Tembo actually loads
tembo.nix, how project environments cache the resulting toolchain, and the two failure modes that currently produce silent "my dependencies are missing" reports. All claims were verified againsttembo/monoreposource — no behavior was inferred.Docs updated
features/sandbox/custom-dependencies.mdx(+24 lines, one file, no navigation changes):flake.nixwithtembo.nix, evaluates the default dev shell, then restores the original. Adds the four consequences that follow:tembo.nixmust be a self-contained flake (no merging), an existingflake.nixis never used for the dev shell,flake.lockis never written (so pinnixpkgsyourself), only the repo root is read, and unfree packages are permitted.tembo.nixdon't reach project sessions until a rebuild or the daily refresh.tembo.nixthat fails to evaluate does not fail the project build; the build succeeds without the dependencies. Points readers at thenix developstep in the build log.Codepaths covered
finallyapps/api/src/agent/sandbox/temboConfig.ts:109-134,apps/api/src/services/hypervisor/qemu/prepare.ts:305-350nix developapps/api/src/agent/sandbox/sandboxExecWrapper.ts:22-33--no-write-lock-fileeverywheresandboxExecWrapper.ts:32,prepare.ts:311-313prepare.ts:284-354,apps/api/src/services/hypervisor/constants.ts:28,36-45apps/api/src/agent/sandbox/exec.ts:208-209,apps/api/src/services/hypervisor/utils.ts:11-25prepare.ts:330-341includeDepsdefaults on in project setupapps/web/components/projects/project-setup.tsx:117Knowledge gaps addressed
The page previously described how to write a
tembo.nixbut nothing about how Tembo consumes it. That left three questions unanswerable from the docs: why a repo's ownflake.nixis ignored, whytembo.nixedits appear to do nothing in project sessions, and why dependencies can be missing from an environment whose build reported success.Verified separately — needs an engineering decision, not documented here
While tracing
.tembo.jsonI found two divergences betweenfeatures/hooks.mdxand currentmain. I deliberately left the page unchanged rather than document what look like regressions fromchore(api): disable legacy sandbox tasks (#9032).prePushnever runs.features/hooks.mdxdocuments it as running before Tembo pushes and opens a PR.runHook('prePush')has zero live call sites — the only two are commented out insolve_issue/index.ts:742andfeedback_loop/index.ts:771, both in tasks disabled by #9032 (2026-06-26). The Zod schema still accepts the key, so aprePushblock is silently ignored. (Unrelated: the guest CLI does run git's ownpre-pushhook inagent/guest/cli/commands/commit.ts:171-259, which is a different mechanism.)Repo-root
.tembo.jsonis not read during sessions. The page says to put the file at your repository root. Inagent_run,TemboConfig.loadFromSandboxreads.tembo.jsonrelative tosandbox.getCwd()(temboConfig.ts:60-61), which is still the default/workspace—refreshReposnever callssetCwd, unlikecloneRepo(git/index.ts:369). Repos are cloned to/workspace/<repo-name>(nix/sandbox/tembo-refresh-repos.nix:160), so/workspace/.tembo.jsondoes not exist and sessionsetupScripthooks are a no-op. The golden/project build path does set cwd per repo (prepare.ts:264), so hooks work correctly there.Happy to follow up with a docs PR once you decide whether these are fixed in code or documented as-is.
Two smaller
hooks.mdxgaps that are intentional and safe to document whenever the above is settled:postCloneis a supported legacy alias forsetupScript(temboConfig.ts:9-20), andsetupScriptis deliberately skipped when a session resumes from a snapshot or prepared project environment (sandboxTask.ts:216-229).Validation
npx mint broken-links→ no broken links found.Note
Low Risk
Documentation-only change to sandbox custom-dependencies docs; no code or runtime behavior is modified.
Overview
Documents how Tembo actually consumes
tembo.nix, not just how to write one.Adds that Tembo temporarily swaps
flake.nixwithtembo.nix(no merge, noflake.lock, root-only, unfree allowed), that project builds cache the toolchain so edits need a rebuild, and that a failed Nix eval still succeeds the project build without dependencies.Reviewed by Cursor Bugbot for commit 62a65ba. Bugbot is set up for automated code reviews on this repo. Configure here.