Skip to content

Commit 44a0fe0

Browse files
committed
fix: catch execFileSync failure in bridge-core sandbox relay
If openshell sandbox ssh-config fails (sandbox not running), the synchronous throw inside the Promise constructor would crash the bridge. Now catches and resolves with a descriptive error message.
1 parent c729c14 commit 44a0fe0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎scripts/bridge-core.js‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ try {
4848
*/
4949
function runAgentInSandbox(message, sessionId) {
5050
return new Promise((resolve) => {
51-
const sshConfig = execFileSync(OPENSHELL, ["sandbox", "ssh-config", SANDBOX], {
52-
encoding: "utf-8",
53-
});
51+
let sshConfig;
52+
try {
53+
sshConfig = execFileSync(OPENSHELL, ["sandbox", "ssh-config", SANDBOX], {
54+
encoding: "utf-8",
55+
});
56+
} catch (err) {
57+
resolve(`Error: sandbox SSH config failed — is '${SANDBOX}' running? ${err.message || err}`);
58+
return;
59+
}
5460

5561
const confDir = fs.mkdtempSync("/tmp/nemoclaw-bridge-ssh-");
5662
const confPath = `${confDir}/config`;

0 commit comments

Comments
 (0)