agents-relay 2.0.121 → 2.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters.js +13 -2
- package/package.json +1 -1
package/dist/adapters.js
CHANGED
|
@@ -195,8 +195,19 @@ function rawBrowserWorkspaceCommand(cli, args, stdin, signal) {
|
|
|
195
195
|
resolve(stdout.trim());
|
|
196
196
|
else if (signal?.aborted)
|
|
197
197
|
reject(new Error('browser-worker execution aborted'));
|
|
198
|
-
else
|
|
199
|
-
|
|
198
|
+
else {
|
|
199
|
+
// Browser Workspace reports a compact code/message JSON on nonzero exit.
|
|
200
|
+
// Preserve existing Relay failure behavior; only simplify the error text.
|
|
201
|
+
let reason = stderr.trim() || stdout.trim() || `browser-workspace exited ${code}`;
|
|
202
|
+
try {
|
|
203
|
+
const envelope = parseWorkspaceJson(stdout);
|
|
204
|
+
const result = envelope.result;
|
|
205
|
+
if (result?.ok === false && typeof result.code === 'string' && typeof result.message === 'string')
|
|
206
|
+
reason = `${result.code}: ${result.message}`;
|
|
207
|
+
}
|
|
208
|
+
catch { /* Preserve legacy error handling for other CLI failures. */ }
|
|
209
|
+
reject(new Error(reason));
|
|
210
|
+
}
|
|
200
211
|
});
|
|
201
212
|
if (signal?.aborted)
|
|
202
213
|
abort();
|