From d7f381a1e8e821a643600e61f8079cc7056688c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Fri, 17 Apr 2026 08:57:08 +0100 Subject: [PATCH] fix(cli): surface broker error messages in ban/unban (alpha.38 fix) Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/cli/package.json | 2 +- apps/cli/src/commands/ban.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 63003b3..b671f17 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "claudemesh-cli", - "version": "1.0.0-alpha.37", + "version": "1.0.0-alpha.38", "description": "Peer mesh for Claude Code sessions — CLI + MCP server.", "keywords": [ "claude-code", diff --git a/apps/cli/src/commands/ban.ts b/apps/cli/src/commands/ban.ts index 12f5dce..623aca1 100644 --- a/apps/cli/src/commands/ban.ts +++ b/apps/cli/src/commands/ban.ts @@ -19,12 +19,12 @@ export async function runBan( if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; } return await withMesh({ meshSlug }, async (client) => { - const result = await client.sendAndWait({ type: "ban", target }) as { banned?: string; error?: string }; + const result = await client.sendAndWait({ type: "ban", target }) as { banned?: string; error?: string; message?: string; code?: string }; if (result?.banned) { render.ok(`Banned ${result.banned} from ${meshSlug}. They cannot reconnect until unbanned.`); render.hint(`Undo: claudemesh unban ${result.banned} --mesh ${meshSlug}`); } else { - render.err(result?.error ?? "ban failed"); + render.err(result?.message ?? result?.error ?? result?.code ?? "ban failed"); } return result?.banned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR; }); @@ -40,11 +40,11 @@ export async function runUnban( if (!meshSlug) { render.err("No mesh joined."); return EXIT.NOT_FOUND; } return await withMesh({ meshSlug }, async (client) => { - const result = await client.sendAndWait({ type: "unban", target }) as { unbanned?: string; error?: string }; + const result = await client.sendAndWait({ type: "unban", target }) as { unbanned?: string; error?: string; message?: string; code?: string }; if (result?.unbanned) { render.ok(`Unbanned ${result.unbanned} from ${meshSlug}. They can rejoin.`); } else { - render.err(result?.error ?? "unban failed"); + render.err(result?.message ?? result?.error ?? result?.code ?? "unban failed"); } return result?.unbanned ? EXIT.SUCCESS : EXIT.INTERNAL_ERROR; });