fix: preserve telegram default auth promotion

This commit is contained in:
Ayaan Zaidi
2026-04-07 09:27:53 +05:30
parent b59560c49a
commit 47e6c57a7a
3 changed files with 39 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ Docs: https://docs.openclaw.ai
- Slack/thread mentions: add `channels.slack.thread.requireExplicitMention` so Slack channels that already require mentions can also require explicit `@bot` mentions inside bot-participated threads. (#58276) Thanks @praktika-engineer.
- UI/light mode: target both root and nested WebKit scrollbar thumbs in the light theme so page-level and container scrollbars stay visible on light backgrounds. (#61753) Thanks @chziyue.
- Matrix/onboarding: add an invite auto-join setup step with explicit off warnings and strict stable-target validation so new Matrix accounts stop silently ignoring invited rooms and fresh DM-style invites unless operators opt in. (#62168) Thanks @gumadeiras.
- Telegram/doctor: stop moving top-level access-control fallback into `accounts.default` during multi-account doctor normalization, so existing named bots keep their inherited allowlist and policy config. (#62263) Thanks @obviyus.
- Telegram/doctor: keep top-level access-control fallback in place during multi-account normalization while still promoting legacy default auth into `accounts.default`, so existing named bots keep inherited allowlists without dropping the legacy default bot. (#62263) Thanks @obviyus.
## 2026.4.5

View File

@@ -1,2 +1,2 @@
export const singleAccountKeysToMove = ["streaming"];
export const namedAccountPromotionKeys: string[] = [];
export const namedAccountPromotionKeys = ["botToken", "tokenFile"] as const;

View File

@@ -383,6 +383,43 @@ describe("normalizeCompatibilityConfigValues", () => {
);
});
it("keeps Telegram policy fallback top-level while still seeding default auth", () => {
const res = normalizeCompatibilityConfigValues({
channels: {
telegram: {
enabled: true,
botToken: "legacy-token",
dmPolicy: "allowlist",
allowFrom: ["123"],
groupPolicy: "allowlist",
accounts: {
bot1: {
enabled: true,
botToken: "bot-1-token",
},
},
},
},
});
expect(res.config.channels?.telegram?.accounts?.default).toMatchObject({
botToken: "legacy-token",
});
expect(res.config.channels?.telegram?.botToken).toBeUndefined();
expect(res.config.channels?.telegram?.dmPolicy).toBe("allowlist");
expect(res.config.channels?.telegram?.allowFrom).toEqual(["123"]);
expect(res.config.channels?.telegram?.groupPolicy).toBe("allowlist");
expect(mergeTelegramAccountConfig(res.config, "default")).toMatchObject({
botToken: "legacy-token",
dmPolicy: "allowlist",
allowFrom: ["123"],
groupPolicy: "allowlist",
});
expect(res.changes).toContain(
"Moved channels.telegram single-account top-level values into channels.telegram.accounts.default.",
);
});
it("migrates browser ssrfPolicy allowPrivateNetwork to dangerouslyAllowPrivateNetwork", () => {
const res = normalizeCompatibilityConfigValues({
browser: {