backup current stable ejclaw state
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {
|
||||
buildInterruptedRestartAnnouncement,
|
||||
getInterruptedRecoveryCandidates,
|
||||
type RestartContext,
|
||||
} from './restart-context.js';
|
||||
@@ -36,6 +37,7 @@ describe('getInterruptedRecoveryCandidates', () => {
|
||||
elapsedMs: 1000,
|
||||
pendingMessages: true,
|
||||
pendingTasks: 0,
|
||||
rewindToSeq: 42,
|
||||
},
|
||||
{
|
||||
chatJid: 'dc:1',
|
||||
@@ -71,6 +73,7 @@ describe('getInterruptedRecoveryCandidates', () => {
|
||||
status: 'processing',
|
||||
pendingMessages: true,
|
||||
pendingTasks: 0,
|
||||
rewindToSeq: 42,
|
||||
},
|
||||
{
|
||||
chatJid: 'dc:2',
|
||||
@@ -78,6 +81,7 @@ describe('getInterruptedRecoveryCandidates', () => {
|
||||
status: 'idle',
|
||||
pendingMessages: false,
|
||||
pendingTasks: 0,
|
||||
rewindToSeq: null,
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -86,3 +90,33 @@ describe('getInterruptedRecoveryCandidates', () => {
|
||||
expect(getInterruptedRecoveryCandidates(null, {})).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildInterruptedRestartAnnouncement', () => {
|
||||
it('promises auto-resume when a rewind seq is captured', () => {
|
||||
const message = buildInterruptedRestartAnnouncement({
|
||||
chatJid: 'dc:1',
|
||||
groupName: 'room',
|
||||
status: 'processing',
|
||||
elapsedMs: 12000,
|
||||
pendingMessages: true,
|
||||
pendingTasks: 0,
|
||||
rewindToSeq: 100,
|
||||
});
|
||||
expect(message).toContain('서비스 재시작으로 이전 작업이 중단됐습니다.');
|
||||
expect(message).toContain('자동으로 이어갑니다');
|
||||
expect(message).not.toContain('필요하면 이어서');
|
||||
});
|
||||
|
||||
it('falls back to manual prompt when no rewind seq exists', () => {
|
||||
const message = buildInterruptedRestartAnnouncement({
|
||||
chatJid: 'dc:1',
|
||||
groupName: 'room',
|
||||
status: 'waiting',
|
||||
elapsedMs: null,
|
||||
pendingMessages: false,
|
||||
pendingTasks: 0,
|
||||
});
|
||||
expect(message).toContain('필요하면 이어서');
|
||||
expect(message).not.toContain('자동으로 이어갑니다');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user