feat(status): add Telegram/WhatsApp troubleshooting warnings
This commit is contained in:
@@ -339,4 +339,42 @@ describe("providers command", () => {
|
||||
expect(lines.join("\n")).toMatch(/Message Content Intent is limited/i);
|
||||
expect(lines.join("\n")).toMatch(/Run: clawdbot doctor/);
|
||||
});
|
||||
|
||||
it("surfaces Telegram privacy-mode hints when allowUnmentionedGroups is enabled", () => {
|
||||
const lines = formatGatewayProvidersStatusLines({
|
||||
telegramAccounts: [
|
||||
{
|
||||
accountId: "default",
|
||||
enabled: true,
|
||||
configured: true,
|
||||
allowUnmentionedGroups: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(lines.join("\n")).toMatch(/Warnings:/);
|
||||
expect(lines.join("\n")).toMatch(/Telegram Bot API privacy mode/i);
|
||||
});
|
||||
|
||||
it("surfaces WhatsApp auth/runtime hints when unlinked or disconnected", () => {
|
||||
const unlinked = formatGatewayProvidersStatusLines({
|
||||
whatsappAccounts: [{ accountId: "default", enabled: true, linked: false }],
|
||||
});
|
||||
expect(unlinked.join("\n")).toMatch(/WhatsApp/i);
|
||||
expect(unlinked.join("\n")).toMatch(/Not linked/i);
|
||||
|
||||
const disconnected = formatGatewayProvidersStatusLines({
|
||||
whatsappAccounts: [
|
||||
{
|
||||
accountId: "default",
|
||||
enabled: true,
|
||||
linked: true,
|
||||
running: true,
|
||||
connected: false,
|
||||
reconnectAttempts: 5,
|
||||
lastError: "connection closed",
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(disconnected.join("\n")).toMatch(/disconnected/i);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -75,6 +75,9 @@ export function formatGatewayProvidersStatusLines(
|
||||
if (typeof account.running === "boolean") {
|
||||
bits.push(account.running ? "running" : "stopped");
|
||||
}
|
||||
if (typeof account.connected === "boolean") {
|
||||
bits.push(account.connected ? "connected" : "disconnected");
|
||||
}
|
||||
if (typeof account.mode === "string" && account.mode.length > 0) {
|
||||
bits.push(`mode:${account.mode}`);
|
||||
}
|
||||
@@ -110,6 +113,9 @@ export function formatGatewayProvidersStatusLines(
|
||||
) {
|
||||
bits.push(`intents:content=${messageContent}`);
|
||||
}
|
||||
if (account.allowUnmentionedGroups === true) {
|
||||
bits.push("groups:unmentioned");
|
||||
}
|
||||
if (typeof account.baseUrl === "string" && account.baseUrl) {
|
||||
bits.push(`url:${account.baseUrl}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user