Skip to content

Conversation

@ereslibre
Copy link
Collaborator

Improves error handling in the sandbox creation flow by ensuring that if the Docker container creation fails, the task is properly reset to NEW status and the error is propagated to the caller.

Previously, when sandbox creation failed, the error was caught but not re-thrown, causing the task command to continue execution and mark the task as in progress despite the failure. This resulted in an inconsistent state where the task appeared to be running but had no container.

Changes

  • Modified Sandbox.createAndStart() to re-throw errors after failing the process manager item in packages/cli/src/lib/sandbox/types.ts:49-54
  • Added mock for createSandbox in restart command tests to prevent actual Docker/Podman calls
  • Added comprehensive E2E test case to verify task reset behavior when Docker container creation fails

Notes

This change ensures proper error propagation through the sandbox creation flow, allowing the task command to properly handle failures and reset task state when container creation fails.

Closes: #313

@ereslibre ereslibre self-assigned this Nov 26, 2025
@ereslibre ereslibre merged commit 277c310 into main Nov 26, 2025
5 checks passed
@ereslibre ereslibre deleted the ereslibre/mark-in-progress-after-sandbox-creation branch November 26, 2025 07:25
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.

Tasks are set as 'In progress' even if sandbox could not be created

2 participants