Skip to content

docs: add externalId documentation for sandboxes#616

Open
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
cdrappier/devin/externalid-docs
Open

docs: add externalId documentation for sandboxes#616
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
cdrappier/devin/externalid-docs

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary\n\nAdds user-facing documentation for the externalId feature on sandboxes (ENG-3141).\n\nTwo changes:\n\n1. Sandboxes/Overview.mdx — New ### External ID section inserted after Labels. Covers: what it is (indexed caller-owned identifier), rules (64 chars, alphanum+dash, mutable, not unique), SDK examples for create/get/list, and CLI manifest example.\n\n2. Sandboxes/best-practices.mdx — New ## Index sandboxes with external IDs section. Explains when to use externalId vs labels (indexed lookup vs client-side filtering), common patterns (session reconnect, idempotent provisioning, multi-tenant), and a practical code example showing the "get or create" pattern."

Link to Devin session: https://app.devin.ai/sessions/cdb3ad07a98841f2adb3a327d0915bf7
Requested by: @drappier-charles


Note

Adds externalId documentation for sandboxes: Overview section with SDK examples for create/get/list, and a best-practices section with indexed lookup patterns. Since last review: added SDK version requirement note, removed CLI manifest example, and fixed cross-page links to use absolute paths.

Written by Mendral for commit 5a58082.

- Add External ID section below Labels in Sandboxes/Overview (creation, retrieval, list filtering, CLI manifest)
- Add 'Index sandboxes with external IDs' best practice section (use cases, code examples, guidance)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

mendral-app[bot]

This comment was marked as outdated.

@mendral-app

mendral-app Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🧪 Testing Guide

What this PR addresses

Adds user-facing documentation for the externalId feature on sandboxes (ENG-3141). Two new sections are introduced:

  1. Sandboxes/Overview.mdx — A new "External ID" subsection covering what it is, validation rules, and SDK examples (create, getByExternalId, list).
  2. Sandboxes/best-practices.mdx — A new "Index sandboxes with external IDs" section explaining when to use externalId vs labels, with a session-reconnect pattern example.

Steps to verify

Since this is a documentation-only change, there is no bug to reproduce. Instead, verify the following:

  1. Local docs build — Run the docs site locally (e.g., mintlify dev or equivalent) and confirm both pages render without errors.
  2. Navigate to Sandboxes → Overview — Scroll to the "External ID" section (after "Labels"). Confirm:
    • The <Note> block renders correctly with version requirements.
    • All three <CodeGroup> blocks (create, getByExternalId, list) display TypeScript and Python tabs properly.
    • The section appears before "Kernel networking".
  3. Navigate to Sandboxes → Best Practices — Scroll to "Index sandboxes with external IDs". Confirm:
    • The section appears after "Use expiration policies" and before "Reduce cold start times with a pre-warmed pool".
    • The <CodeGroup> with the reconnect pattern renders correctly.
    • The <Note> about non-uniqueness renders properly.
    • Internal links to /Sandboxes/Expiration and /Sandboxes/Overview#labels resolve correctly.

What to verify (expected behavior)

  • All new markdown renders correctly with no broken formatting, missing code blocks, or layout issues.
  • Code examples use consistent naming conventions (externalId in TypeScript, external_id in Python).
  • No regressions in surrounding content (Labels section, Kernel networking section, expiration policies section remain intact).
  • Navigation/sidebar reflects the new anchors if applicable.

Note

Posted by PR Testing Guide · Tag @mendral-app with feedback.

@mendral-app

mendral-app Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

✅ Linked to Linear issue ENG-3141 — status already In Progress, assigned to Charles Drappier.

Note

Posted by Linear Issue Enforcer · Tag @mendral-app with feedback.

@mendral-app

mendral-app Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Flow Analysis

This PR is documentation-only — it adds user-facing docs for the externalId feature across two MDX files. No code, services, or infrastructure components are changed, so a sequence diagram isn't applicable here.

Changes summary:

  • Sandboxes/Overview.mdx — New "External ID" section covering rules, SDK usage (create/get/list), and CLI manifest examples.
  • Sandboxes/best-practices.mdx — New best-practices section with patterns like session reconnect, idempotent provisioning, and multi-tenant isolation.

No architectural interactions to diagram. ✅

Note

Posted by PR Sequence Diagram · Tag @mendral-app with feedback.

Requires @blaxel/core >= 0.2.92 (TypeScript) or blaxel >= 0.2.57 (Python).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Comment thread Sandboxes/best-practices.mdx Outdated
Comment thread Sandboxes/best-practices.mdx Outdated
Comment thread Sandboxes/Overview.mdx Outdated
Ok with all, for the version I think we not do it for other and the way to do it is more : Always saying to use the last one

Co-authored-by: vikram-blaxel <vvaswani@blaxel.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@drappier-charles drappier-charles marked this pull request as ready for review June 23, 2026 16:24

@mendral-app mendral-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Changes since last review are editorial improvements (version note, link fixes, CLI manifest removal per reviewer feedback). Documentation remains accurate and well-structured. No issues found.

Tag @mendral-app with feedback or questions. View session

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +110 to +126
- **One sandbox per user session**: Tag each sandbox with your session ID. When the user returns, call `getByExternalId` to reconnect to the same environment instantly.
- **Idempotent provisioning**: Before creating a new sandbox, check if one already exists for your workflow ID. This avoids duplicate sandbox creation in retry scenarios.
- **Multi-tenant isolation**: Tag sandboxes with tenant or user IDs for quick per-tenant enumeration via `list({ externalId })`.

<CodeGroup>

```typescript TypeScript
// Reconnect to the user's sandbox, or create one if none exists
let sandbox = await SandboxInstance.getByExternalId(sessionId);
if (!sandbox) {
sandbox = await SandboxInstance.create({
name: uniqueName(),
image: "blaxel/base-image:latest",
externalId: sessionId,
region: "us-pdx-1"
});
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🚩 TOCTOU gap in the 'idempotent provisioning' example pattern

The best-practices section at Sandboxes/best-practices.mdx:111 lists "Idempotent provisioning" as a common pattern and says it "avoids duplicate sandbox creation in retry scenarios." However, the code example at lines 118-126 uses getByExternalId followed by create() with uniqueName(). This check-then-act pattern has a TOCTOU (time-of-check-time-of-use) gap: two concurrent retries could both see no existing sandbox and both call create() with different unique names, resulting in duplicate sandboxes sharing the same externalId. The note at line 144 even acknowledges that externalId is not unique. This pattern is only idempotent for sequential retries, not concurrent ones. Given that the earlier section at line 116 recommends createIfNotExists() for idempotent creation, the example could be improved to use a deterministic name with createIfNotExists() instead.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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