fix: 增加thinking disabled

修改退群监控模板
定时日报保存日报历史
This commit is contained in:
Wxw-Gu
2026-09-01 11:40:14 +08:00
parent 25b72c3d76
commit 1c8bbae1f0
21 changed files with 343 additions and 34 deletions
+13 -1
View File
@@ -1,4 +1,4 @@
import { mkdtempSync, readJsonSync, rmSync } from 'fs-extra'
import { mkdtempSync, readJsonSync, rmSync, writeJsonSync } from 'fs-extra'
import { tmpdir } from 'os'
import { join } from 'path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -32,6 +32,7 @@ vi.mock('../../src/main/services/personal-wechat-send-service', () => ({
}))
import { GroupExitMonitorService } from '../../src/main/services/group-exit-monitor-service'
import { GROUP_EXIT_NOTIFICATION_TEMPLATE } from '../../src/shared/group-exit-monitor'
const member = { wxid: 'wxid_member', wechatNickname: '微信名', groupNickname: '群内名' }
@@ -77,6 +78,17 @@ describe('GroupExitMonitorService', () => {
expect(() => service.setNotificationTemplate('用户: {unknown}')).toThrow('不支持的占位符')
})
it('migrates the previous default notification template', () => {
writeJsonSync(join(mocks.userData, 'group-exit-monitor.json'), {
notificationTemplate:
'[退群监测]\n\n用户: {user}\n\n群备注: {groupRemark}\n\n微信号: {wxid}\n\n退群时间: {time}'
})
const service = new GroupExitMonitorService()
expect(service.getState().notificationTemplate).toBe(GROUP_EXIT_NOTIFICATION_TEMPLATE)
})
it('keeps the previous baseline when a native snapshot contains null members', async () => {
installGroupDb()
mocks.chat.getGroupSnapshotAsync.mockResolvedValueOnce({