Delete all sandboxes matching the given labels.
This is useful for cleaning up stale sandboxes from previous test runs or CI pipelines that may not have shut down cleanly.
deleteAll(
labels: Record<string, string>,
options: Pick<DaytonaSandboxOptions, "auth" | "target">
): Promise<number>| Name | Type | Description |
|---|---|---|
labels* | Record<string, string> | Label key-value pairs to filter sandboxes |
options | Pick<DaytonaSandboxOptions, "auth" | "target"> | Optional auth configuration |
// Clean up all integration-test sandboxes
const deleted = await DaytonaSandbox.deleteAll({
purpose: "integration-test",
package: "@langchain/daytona",
});
console.log(`Deleted ${deleted} stale sandboxes`);