Add Amp sandbox tutorial - #727
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
🔍 PR Interaction FlowThis is a docs-only PR (new tutorial + nav entry), so there are no runtime code changes. However, the tutorial documents a meaningful interaction flow between components. Here's a sequence diagram of the user workflow described in the tutorial: sequenceDiagram
participant User as User Script
participant SDK as Blaxel SDK
participant Sandbox as Blaxel Sandbox
participant Git as Git Host
participant Amp as Amp CLI
User->>SDK: createIfNotExists("amp-sandbox")
SDK->>Sandbox: Provision (blaxel/amp:latest, 8GB, env: AMP_API_KEY)
Sandbox-->>SDK: Sandbox ready
SDK-->>User: SandboxInstance
User->>Sandbox: process.exec(git clone)
Sandbox->>Git: git clone --depth 1
Git-->>Sandbox: Repository files
Sandbox-->>User: exitCode 0
User->>Sandbox: process.exec(amp --stream-json --execute ...)
Sandbox->>Amp: Run task in repository
Amp-->>Sandbox: JSON event stream (init, content, result)
Sandbox-->>User: Stream stdout + exitCode
Note over Sandbox: Sandbox enters standby
User->>SDK: SandboxInstance.get("amp-sandbox")
SDK->>Sandbox: Wake from standby
Sandbox-->>User: Resumed instance
User->>Sandbox: process.exec(amp threads continue <threadId>)
Sandbox->>Amp: Continue existing thread
Amp-->>Sandbox: JSON event stream (result)
Sandbox-->>User: Stream stdout + exitCode
User->>SDK: bl delete sandbox amp-sandbox
SDK->>Sandbox: Terminate
SummaryThe tutorial walks through a 4-phase lifecycle:
No code/infra review concerns — this is a well-structured documentation addition. Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
🧪 Testing GuideWhat this PR addressesAdds a new tutorial page ( Steps to verify the new content
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
|
✅ Linked to Linear issue ENG-4631 — status already In Progress, assigned to Michael Stolarz. Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
There was a problem hiding this comment.
LGTM
The tutorial code is well-structured with correct shell quoting (preventing injection), proper secret handling via environment variables, and sound JSON event validation logic. The riskiest area—shell command construction with user-supplied REPOSITORY_URL and AMP_THREAD_ID—is properly handled by shellQuote/shlex.quote in both languages. No security, correctness, or data-integrity issues found.
Tag @mendral-app with feedback or questions. View session
77f0472 to
3a4e815
Compare
Summary
AMP_API_KEYhandlingWhy
Users need one complete path from account setup through a real Amp task, reconnection, and cleanup. The guide keeps the examples readable while checking both process exit status and Amp's final structured result.
Verification
Dependency
This documentation depends on blaxel-ai/sandbox#285. Do not merge or publish this tutorial until the Amp image is approved and released.
No Amp outreach is included in this PR.
Linear: ENG-4614, ENG-4631
Note
Adds a complete tutorial (
Tutorials/Amp.mdx) for running Amp inside a Blaxel sandbox with TypeScript and Python examples covering sandbox creation, streaming a coding task, continuing a thread after reconnection, and cleanup. Also adds the tutorial to the docs navigation indocs.json.Written by Mendral for commit 77f0472.
Note
Low Risk
Documentation-only: a new tutorial page and nav entry. No product, auth, or runtime code changes.
Overview
Adds a complete Amp-on-Blaxel tutorial (
Tutorials/Amp.mdx) and lists it under a new Amp group in Tutorials navigation.The guide walks through SDK setup, creating a
blaxel/amp:latestsandbox withAMP_API_KEY, cloning a repo, streaming a headless Amp task, parsing JSON events for thread ID and success, then continuing the same private thread after standby. It also covers interactivebl connect, safety notes for unattended Amp, troubleshooting, and cleanup.Reviewed by Cursor Bugbot for commit 3a4e815. Bugbot is set up for automated code reviews on this repo. Configure here.