Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

refactor: include humanized error message in JSON output for failed link attempts

0xken159b03160ce9b6
diff --git a/cli/src/cli.ts b/cli/src/cli.ts
index 69dea594b..bad3d7fd2 100644
--- a/cli/src/cli.ts
+++ b/cli/src/cli.ts
@@ -4827,10 +4827,11 @@ async function linkConnectCommand(machineId: string | undefined, stdin: boolean,
onProgress: json ? (stage) => console.log(JSON.stringify({ stage })) : undefined,
})
if (!result.ok) {
+ const message = humanizeLinkError(result.error, machineId, result.retryAt)
if (json) {
- console.log(JSON.stringify({ ok: false, error: result.error, ...(result.retryAt !== undefined ? { retryAt: result.retryAt } : {}) }))
+ console.log(JSON.stringify({ ok: false, error: result.error, message, ...(result.retryAt !== undefined ? { retryAt: result.retryAt } : {}) }))
} else {
- console.error(`\n ✗ ${humanizeLinkError(result.error, machineId, result.retryAt)}\n`)
+ console.error(`\n ✗ ${message}\n`)
}
process.exit(1)
return