chore: stabilize Zhinian pilot delivery

This commit is contained in:
inman
2026-05-12 19:44:44 +08:00
parent 45389855e1
commit 20b5aff4ad
174 changed files with 41428 additions and 784 deletions

View File

@@ -147,16 +147,20 @@ describe('WeCom plugin configuration', () => {
await rm(testUserData, { recursive: true, force: true });
});
it('sets plugins.entries.wecom.enabled when saving wecom config', async () => {
it('saves wecom as a built-in channel and keeps stale plugin registration disabled', async () => {
const { saveChannelConfig } = await import('@electron/utils/channel-config');
await saveChannelConfig('wecom', { botId: 'test-bot', secret: 'test-secret' }, 'agent-a');
const config = await readOpenClawJson();
const plugins = config.plugins as { allow: string[], entries: Record<string, { enabled?: boolean }> };
expect(plugins.allow).toContain('wecom');
expect(plugins.entries['wecom'].enabled).toBe(true);
const channels = config.channels as Record<string, { enabled?: boolean; accounts?: Record<string, { botId?: string; enabled?: boolean }> }>;
expect(channels.wecom.enabled).toBe(true);
expect(channels.wecom.accounts?.['agent-a']).toMatchObject({
botId: 'test-bot',
enabled: true,
});
expect(config.plugins).toBeUndefined();
});
it('saves whatsapp as a built-in channel instead of a plugin', async () => {