fix: clarify doctor auto-enable hint
This commit is contained in:
@@ -16,6 +16,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Zalouser: add channel dock metadata, config schema, setup wiring, probe, and status issues. (#1219) — thanks @suminhthanh.
|
- Zalouser: add channel dock metadata, config schema, setup wiring, probe, and status issues. (#1219) — thanks @suminhthanh.
|
||||||
### Fixes
|
### Fixes
|
||||||
- Discovery: shorten Bonjour DNS-SD service type to `_clawdbot-gw._tcp` and update discovery clients/docs.
|
- Discovery: shorten Bonjour DNS-SD service type to `_clawdbot-gw._tcp` and update discovery clients/docs.
|
||||||
|
- Doctor: clarify plugin auto-enable hint text in the startup banner.
|
||||||
- Web search: infer Perplexity base URL from API key source (direct vs OpenRouter).
|
- Web search: infer Perplexity base URL from API key source (direct vs OpenRouter).
|
||||||
- TUI: keep thinking blocks ordered before content during streaming and isolate per-run assembly. (#1202) — thanks @aaronveklabs.
|
- TUI: keep thinking blocks ordered before content during streaming and isolate per-run assembly. (#1202) — thanks @aaronveklabs.
|
||||||
- TUI: align custom editor initialization with the latest pi-tui API. (#1298) — thanks @sibbl.
|
- TUI: align custom editor initialization with the latest pi-tui API. (#1298) — thanks @sibbl.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
|
|
||||||
expect(result.config.plugins?.entries?.slack?.enabled).toBe(true);
|
expect(result.config.plugins?.entries?.slack?.enabled).toBe(true);
|
||||||
expect(result.config.plugins?.allow).toEqual(["telegram", "slack"]);
|
expect(result.config.plugins?.allow).toEqual(["telegram", "slack"]);
|
||||||
expect(result.changes.join("\n")).toContain('Enabled plugin "slack"');
|
expect(result.changes.join("\n")).toContain("Slack configured, not enabled yet.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("respects explicit disable", () => {
|
it("respects explicit disable", () => {
|
||||||
@@ -74,8 +74,8 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
|
|
||||||
expect(result.config.plugins?.entries?.bluebubbles?.enabled).toBe(true);
|
expect(result.config.plugins?.entries?.bluebubbles?.enabled).toBe(true);
|
||||||
expect(result.config.plugins?.entries?.imessage?.enabled).toBeUndefined();
|
expect(result.config.plugins?.entries?.imessage?.enabled).toBeUndefined();
|
||||||
expect(result.changes.join("\n")).toContain('Enabled plugin "bluebubbles"');
|
expect(result.changes.join("\n")).toContain("bluebubbles configured, not enabled yet.");
|
||||||
expect(result.changes.join("\n")).not.toContain('Enabled plugin "imessage"');
|
expect(result.changes.join("\n")).not.toContain("iMessage configured, not enabled yet.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps imessage enabled if already explicitly enabled (non-destructive)", () => {
|
it("keeps imessage enabled if already explicitly enabled (non-destructive)", () => {
|
||||||
@@ -108,7 +108,7 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
|
|
||||||
expect(result.config.plugins?.entries?.bluebubbles?.enabled).toBe(false);
|
expect(result.config.plugins?.entries?.bluebubbles?.enabled).toBe(false);
|
||||||
expect(result.config.plugins?.entries?.imessage?.enabled).toBe(true);
|
expect(result.config.plugins?.entries?.imessage?.enabled).toBe(true);
|
||||||
expect(result.changes.join("\n")).toContain('Enabled plugin "imessage"');
|
expect(result.changes.join("\n")).toContain("iMessage configured, not enabled yet.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows imessage auto-enable when bluebubbles is in deny list", () => {
|
it("allows imessage auto-enable when bluebubbles is in deny list", () => {
|
||||||
@@ -136,7 +136,7 @@ describe("applyPluginAutoEnable", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(result.config.plugins?.entries?.imessage?.enabled).toBe(true);
|
expect(result.config.plugins?.entries?.imessage?.enabled).toBe(true);
|
||||||
expect(result.changes.join("\n")).toContain('Enabled plugin "imessage"');
|
expect(result.changes.join("\n")).toContain("iMessage configured, not enabled yet.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -335,6 +335,16 @@ function enablePluginEntry(cfg: ClawdbotConfig, pluginId: string): ClawdbotConfi
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatAutoEnableChange(entry: PluginEnableChange): string {
|
||||||
|
let reason = entry.reason.trim();
|
||||||
|
const channelId = normalizeChatChannelId(entry.pluginId);
|
||||||
|
if (channelId) {
|
||||||
|
const label = getChatChannelMeta(channelId).label;
|
||||||
|
reason = reason.replace(new RegExp(`^${channelId}\\b`, "i"), label);
|
||||||
|
}
|
||||||
|
return `${reason}, not enabled yet.`;
|
||||||
|
}
|
||||||
|
|
||||||
export function applyPluginAutoEnable(params: {
|
export function applyPluginAutoEnable(params: {
|
||||||
config: ClawdbotConfig;
|
config: ClawdbotConfig;
|
||||||
env?: NodeJS.ProcessEnv;
|
env?: NodeJS.ProcessEnv;
|
||||||
@@ -362,7 +372,7 @@ export function applyPluginAutoEnable(params: {
|
|||||||
if (alreadyEnabled && !allowMissing) continue;
|
if (alreadyEnabled && !allowMissing) continue;
|
||||||
next = enablePluginEntry(next, entry.pluginId);
|
next = enablePluginEntry(next, entry.pluginId);
|
||||||
next = ensureAllowlisted(next, entry.pluginId);
|
next = ensureAllowlisted(next, entry.pluginId);
|
||||||
changes.push(`Enabled plugin "${entry.pluginId}" (${entry.reason}).`);
|
changes.push(formatAutoEnableChange(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
return { config: next, changes };
|
return { config: next, changes };
|
||||||
|
|||||||
Reference in New Issue
Block a user