fix: restore message migration CI coverage

This commit is contained in:
_Kerman
2026-07-28 14:29:54 +08:00
parent 744a821319
commit 971f20b66e
8 changed files with 39 additions and 12 deletions

View File

@@ -2643,6 +2643,11 @@ describe('pi-tui chat lifecycle and transcript', () => {
// A foreign agent's discard leaves the wrapper armed.
const foreign = { ...result.agent, id: SessionId('foreign') } as unknown as Agent
result.ctx.emit('agent/inbox/discard', foreign, [result.agent.sentMessages.at(-1)!])
// An unrelated discard for this agent also leaves the wrapper armed.
result.ctx.emit('agent/inbox/discard', result.agent, [createUserMessage({
content: [{ type: 'text', text: 'unrelated discard' }],
source: { kind: 'user' },
})])
result.ctx.emit('agent/inbox/discard', result.agent, [result.agent.sentMessages.at(-1)!])
await tick()
// Idempotent: a repeat discard after cleanup is a no-op.