fix: honor googlechat default setup status

This commit is contained in:
Tak Hoffman 2026-04-03 15:14:55 -05:00
parent ee63fdb056
commit de6997a203
No known key found for this signature in database
2 changed files with 23 additions and 7 deletions

View File

@ -104,13 +104,7 @@ export const googlechatSetupWizard: ChannelSetupWizard = {
unconfiguredHint: "needs auth",
includeStatusLine: true,
resolveConfigured: ({ cfg, accountId }) =>
accountId
? resolveGoogleChatAccount({ cfg, accountId }).credentialSource !== "none"
: listGoogleChatAccountIds(cfg).some(
(resolvedAccountId) =>
resolveGoogleChatAccount({ cfg, accountId: resolvedAccountId }).credentialSource !==
"none",
),
resolveGoogleChatAccount({ cfg, accountId }).credentialSource !== "none",
}),
introNote: {
title: "Google Chat setup",

View File

@ -211,6 +211,28 @@ describe("googlechat setup", () => {
expect(status.configured).toBe(false);
});
it("reports configured state for the configured defaultAccount instead of any account", async () => {
const status = await googlechatStatus({
cfg: {
channels: {
googlechat: {
defaultAccount: "alerts",
accounts: {
default: {
serviceAccount: { client_email: "default@example.com" },
},
alerts: {},
},
},
},
} as OpenClawConfig,
accountOverrides: {},
options: {},
});
expect(status.configured).toBe(false);
});
it("reports account-scoped config keys for named accounts", () => {
expect(googlechatPlugin.setupWizard?.dmPolicy?.resolveConfigKeys?.({}, "alerts")).toEqual({
policyKey: "channels.googlechat.accounts.alerts.dm.policy",