You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Contributes to the largest cluster of
https://linear.app/warpdotdev/issue/REMOTE-2338/sandbox-unexpectedly-failed
When a setup command causes the shell to exit, we weren't reporting this
failure. The run would end up stuck at `Session Started` until
eventually the sandbox closes 12 hours later.
Now, we detect shell exit in setup commands and report the failure with
an error message, closing the sandbox. We also update the
`AgentExitedShell` error to include the command name.
## Testing
<!--
How did you test this change? What automated tests did you add? If you
didn't add any new tests, what's your justification for not adding any?
Manual testing is required for changes that can be manually tested, and
almost all changes can be manually tested. If your change can be
manually tested, please include screenshots or a screen recording that
show it working end to end.
You can run the app locally using `./script/run` - see AGENTS.md for
more details on how to get set up.
-->
- [x] I have manually tested my changes locally with `./script/run`
Reproduced the original issue using an environment with `exit` as a
setup command. In staging the run is stuck at session started. The
sandbox is alive, but the shared session is dead. 12 hours later the
sandbox will close, putting it in error with `Sandbox unexpectedly
closed`
https://oz.staging.warp.dev/runs/019fb010-6a48-7b9e-9ea5-9fe0f0df939c?createdBy=5biMwfUWwagla4lNcR9OSWcZW9H3
Testing locally, it now reports the failure
### Screenshots / Videos
<!-- Attach screenshots or a short video demonstrating the change, where
appropriate. Remove this section if it is not relevant to your PR. -->
<img width="441" height="854" alt="Screenshot 2026-07-29 at 4 15 07 PM"
src="https://github.com/user-attachments/assets/6d3e37ff-fe95-46b3-a89f-6d086baa5cb0"
/>
"Warp lost connection while receiving the agent response. This is usually temporary.";
742
-
/// User-facing message shown when an agent-issued command exits the shell.
743
-
pubconstAGENT_EXITED_SHELL_MESSAGE:&'staticstr = "The shell exited while the agent was running a command, so the run could not continue. Ensure the agent is not asked to run commands or source scripts that can exit the shell.";
744
744
/// Creates a transient network error. `kind` is the structured cause (including the raw API
745
745
/// error where one exists), preserved so user reports can disambiguate the different causes
746
746
/// behind the shared user-facing copy.
@@ -918,7 +918,12 @@ impl Display for RenderableAIError {
0 commit comments