@mindfoldhq/runtime-manager 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8943,6 +8943,7 @@ class E2BProvider {
8943
8943
  await this.killTrackedRunnerCommand(tracked, "respawn");
8944
8944
  let command;
8945
8945
  try {
8946
+ await this.cleanupPersistedRunnerState(tracked.sandbox, workspaceRoot, tracked, "respawn");
8946
8947
  tracked.reposFilePath = reposFilePath;
8947
8948
  if (reposFilePath) {
8948
8949
  await tracked.sandbox.files.write(reposFilePath, serializeRuntimeReposManifest(remoteRepos));
@@ -9057,7 +9058,10 @@ class E2BProvider {
9057
9058
  return result;
9058
9059
  }
9059
9060
  async prepareRestoredSandbox(sandbox, workspaceRoot, tracked) {
9060
- const result = await sandbox.commands.run(this.restoredSandboxCleanupCommand(workspaceRoot), {
9061
+ await this.cleanupPersistedRunnerState(sandbox, workspaceRoot, tracked, "restore");
9062
+ }
9063
+ async cleanupPersistedRunnerState(sandbox, workspaceRoot, tracked, reason) {
9064
+ const result = await sandbox.commands.run(this.persistedRunnerCleanupCommand(workspaceRoot), {
9061
9065
  cwd: "/",
9062
9066
  timeoutMs: DEFAULT_CLEANUP_TIMEOUT_MS,
9063
9067
  onStdout: (data) => {
@@ -9068,13 +9072,14 @@ class E2BProvider {
9068
9072
  }
9069
9073
  });
9070
9074
  if (isCommandHandle(result)) {
9071
- throw new Error("E2B restore cleanup unexpectedly ran in background");
9075
+ throw new Error(`E2B ${reason} cleanup unexpectedly ran in background`);
9072
9076
  }
9073
9077
  if (result.exitCode !== 0) {
9074
- throw new Error(`E2B restore cleanup exited ${result.exitCode}: ${redactDiagnosticString(result.stderr)}`);
9078
+ throw new Error(`E2B ${reason} cleanup exited ${result.exitCode}: ${redactDiagnosticString(result.stderr)}`);
9075
9079
  }
9080
+ log8.info({ sandbox_id: sandbox.sandboxId, reason }, "E2B persisted runner cleanup completed");
9076
9081
  }
9077
- restoredSandboxCleanupCommand(workspaceRoot) {
9082
+ persistedRunnerCleanupCommand(workspaceRoot) {
9078
9083
  const socketPath = shellQuote2(`${workspaceRoot}/.vine/vine.sock`);
9079
9084
  return [
9080
9085
  "set -eu;",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/runtime-manager",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Vine runtime manager CLI",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",