@botbuddy/cli 1.45.2 → 1.45.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.45.2",
3
+ "version": "1.45.3",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -77,6 +77,12 @@ export function repairFailureRecovery(code, error = null) {
77
77
  if (code === "client_key_unavailable") {
78
78
  return "the client key could not be read (locked or failing credential store); unlock it, then run `bb doctor --fix`";
79
79
  }
80
+ // BOT-1787: this is a server-side identity conflict, not an authentication
81
+ // failure. Preserve the real remedy so a healthy credential is never needlessly
82
+ // rotated; `bb setup` clears this worktree's cache and re-registers it.
83
+ if (code === "agent_tenant_immutable") {
84
+ return "this worktree's agent identity belongs to another tenant; run `bb setup` to register this tenant, then `bb doctor --fix`";
85
+ }
80
86
  // BOT-1750 (Codex R9 P2): `session_mint_unauthorized` means a locally-unexpired
81
87
  // client key was revoked/rejected server-side — only a fresh login replaces it, so
82
88
  // point at `bb login`, not a binding repair (the binding is valid).
Binary file
package/src/api.mjs CHANGED
@@ -445,7 +445,13 @@ export async function callToolJson(toolName, args = {}, { fetchImpl = fetch, sig
445
445
  }
446
446
  let payload;
447
447
  try { payload = await res.json(); } catch { return { ok: false, status: res.status, error: "invalid_json" }; }
448
- if (payload.error?.message) return { ok: false, status: res.status, error: payload.error.message };
448
+ if (payload.error?.message) {
449
+ // Typed domain errors retain their verdict inside the HTTP-200 JSON-RPC
450
+ // envelope. Do not infer credential failure from an identity conflict.
451
+ const code = payload.error.data?.code;
452
+ return { ok: false, status: res.status, error: payload.error.message,
453
+ ...(typeof code === "string" && code ? { code } : {}) };
454
+ }
449
455
  const text = payload.result?.content?.map((c) => c.text).filter(Boolean).join("\n") ?? "";
450
456
  let data;
451
457
  try { data = text ? JSON.parse(text) : {}; } catch { data = { raw: text }; }
@@ -1 +0,0 @@
1
- {"schema_version":1,"source_version":"1.45.1","source_identity":"2fa051c4d0ee5cb09fda8d9e15c4952af94d701a6a43e98c8831912040cb41f2"}