mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-02 22:00:19 +00:00
fix: show cleanup warning when script is interrupted by Ctrl+C (#723)
Previously, when a user hit Ctrl+C during script execution, the CLI silently exited with code 130. This left users unaware that a server may have already been created and could still be running, potentially incurring charges. Now shows a warning about orphaned resources before exiting. Agent: ux-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8140c1b61b
commit
96d96b3ef6
2 changed files with 17 additions and 4 deletions
|
|
@ -648,6 +648,10 @@ async function execScript(cloud: string, agent: string, prompt?: string, authHin
|
|||
} catch (err) {
|
||||
const errMsg = getErrorMessage(err);
|
||||
if (errMsg.includes("interrupted by user")) {
|
||||
console.error();
|
||||
p.log.warn("Script interrupted (Ctrl+C).");
|
||||
p.log.warn("If a server was already created, it may still be running.");
|
||||
p.log.warn(` Check your cloud provider dashboard to stop or delete any unused servers.`);
|
||||
process.exit(130);
|
||||
}
|
||||
lastErr = errMsg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue