sandbox: out-of-band computer status and restart via the execute tool (#469)
When a sandbox wedges (the guest stops answering, then every exec fails instantly), the agent's only signal is hanging commands and its only remedy is a human operator restarting the machine by hand. The execute tool gains an optional computer: "status" | "restart" parameter that acts out-of-band on the scoped computer's control plane, so it works precisely when the box can't run anything: status combines the provider's health-check endpoint with a shell probe (surfacing the "machine healthy, shell not answering" wedge signature), and restart reboots the machine — files survive, running processes don't, and the tool result says an interrupted command may or may not have taken effect. The Sandbox interface gains optional computerStatus/restartComputer hooks; backends that don't implement them return a clear capability-unsupported error. No automatic restart policy is baked in — the agent decides, using signals it can observe. **Deployment notes** Behavior flip: a stalled sprite exec channel now triggers an automatic machine restart (deduped, 2-min cooldown) instead of hanging to deadline — a live sandbox can now be rebooted by the platform without operator action; surfaced via onError as sprite_restarted Restart cooldown state is in-memory per instance, so blue-green can at worst issue one restart per instance — bounded and acceptable; no schema/config changes <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/yc-software/codesmith/qm/pr/409"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1789239568&installation_model_id=19911&pr_number=409&repository=yc-software%2Fqm&return_to=https%3A%2F%2Fgithub.com%2Fyc-software%2Fqm%2Fpull%2F409&signature=be94dea33b3bffbafcf2712946b59d0ad3fbe827b7f769c319b39aa72bd81ffb"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a> <sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need. Autofix is disabled.</sup> <!-- codesmith:autofix:disabled --> <!-- /codesmith:footer -->
R
Regan Bell committed
28eb08aaded3d8a92f1536ffa8f6fa5a55e87215
Parent: 5378e06
Committed by GitHub <noreply@github.com>
on 8/13/2026, 9:52:18 PM