Skip to content

docs: add snapshot, suspend & resume example#764

Merged
james-rl merged 5 commits intomainfrom
james/ex-snp
Apr 13, 2026
Merged

docs: add snapshot, suspend & resume example#764
james-rl merged 5 commits intomainfrom
james/ex-snp

Conversation

@james-rl
Copy link
Copy Markdown
Contributor

Adds the last of the examples for basic devbox operations.

@james-rl james-rl requested a review from sid-rl March 24, 2026 00:48
Comment thread examples/devbox_snapshots.py Outdated
Comment thread examples/devbox_snapshots.py Outdated
Comment thread examples/devbox_snapshots.py
Comment thread examples/devbox_snapshots.py Outdated
Comment thread README.md Outdated
## Examples

Workflow-oriented runnable examples are documented in [`EXAMPLES.md`](./EXAMPLES.md).
For a suspend/resume plus shared snapshot restore workflow, see [`examples/devbox_snapshots.py`](./examples/devbox_snapshots.py).
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.

this is the only example that gets a dedicated callout in the main README. why?

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.

llm thing I didn't catch :/

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.

overall looks good, but seems very similar to devbox_snapshot_resume.py. could these two be consolidated into one example?

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.

Thank you for the great feedback in this PR. I made changes to address the issues you highlighted. The cleanup code is a lot less hairy now.

In regards to your more general point: we could consolidate these demos but I feel like they're for slightly different use cases. I think it's better to keep them separate but this is mostly based on impressions of how I think agents and llms will process these docs.

Copy link
Copy Markdown
Contributor

@sid-rl sid-rl left a comment

Choose a reason for hiding this comment

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

looks great! just some minor cleanup and questions

Comment thread examples/devbox_snapshots.py Outdated
Comment thread examples/devbox_snapshots.py Outdated
Comment thread examples/devbox_snapshots.py
Comment thread examples/devbox_snapshots.py
Comment thread examples/devbox_snapshots.py
Comment thread examples/devbox_snapshots.py Outdated
Comment on lines +168 to +179
ExampleCheck(
name="snapshot-backed devboxes stay isolated from one another",
passed=(
len(
{
source_isolated_readback,
clone_a_isolated_readback,
clone_b_isolated_readback,
}
)
== 3
),
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.

isn't this guaranteed to pass when the previous check passes?

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.

yeah, this is an artifact from when this worked differently

Comment thread examples/devbox_snapshots.py Outdated
@james-rl james-rl merged commit f4b942b into main Apr 13, 2026
7 checks passed
@james-rl james-rl deleted the james/ex-snp branch April 13, 2026 20:19
@stainless-app stainless-app Bot mentioned this pull request Apr 13, 2026
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