teapot-coding-agent 0.36.10 → 0.37.0

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.
@@ -291,10 +291,26 @@ export class McpRegistry {
291
291
  await this.finishFlow(name, pending);
292
292
  }
293
293
  catch (e) {
294
- auth.markError(e.message);
294
+ /**
295
+ * Report the CAUSE, not just the message.
296
+ *
297
+ * `UnauthorizedError` defaults its message to the bare string "Unauthorized" when the SDK
298
+ * constructs it without one (measured in the SDK source: `super(message ?? "Unauthorized")`).
299
+ * That is what the panel was showing, and it says nothing about which step failed — the
300
+ * exchange, the reconnect after it, or the original 401. The class name and any `cause`
301
+ * are the difference between "try again" and a diagnosis.
302
+ */
303
+ const err = e;
304
+ const name = err.constructor?.name ?? "Error";
305
+ const cause = err.cause instanceof Error ? err.cause.message : String(err.cause ?? "");
306
+ const detail = [err.message, cause && cause !== err.message ? `(${cause})` : ""]
307
+ .filter(Boolean)
308
+ .join(" ");
309
+ const message = `${name}: ${detail}`;
310
+ auth.markError(message);
295
311
  if (st.status === "authorizing")
296
312
  st.status = "error";
297
- st.lastError = e.message;
313
+ st.lastError = message;
298
314
  await this.finishFlow(name, pending);
299
315
  }
300
316
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.36.10",
3
+ "version": "0.37.0",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",