feat(schedule): add durable after reminders
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
||||
ScheduleId,
|
||||
ScheduleInputError,
|
||||
ScheduleLogError,
|
||||
SCHEDULE_REMINDER_PRESENTATION_KEY,
|
||||
allocateScheduleId,
|
||||
createAfterScheduleRecord,
|
||||
decodeScheduleChange,
|
||||
@@ -98,7 +97,6 @@ describe('version-1 Schedule decoding and folding', () => {
|
||||
scheduleEvent(createData('same-id', 'child prompt'), 2),
|
||||
scheduleEvent({ version: 1, operation: 'dispatch', id: 'same-id' }, 3),
|
||||
]
|
||||
expect(SCHEDULE_REMINDER_PRESENTATION_KEY).toBe('schedule/reminder')
|
||||
expect(scheduleReminderPresentation(events, 1, 2)).toEqual({
|
||||
scheduleId: 'same-id',
|
||||
prompt: 'parent prompt',
|
||||
|
||||
@@ -185,6 +185,17 @@ describe('Schedule tool protocol', () => {
|
||||
.toMatchObject({ id: 'schedule-2' })
|
||||
})
|
||||
|
||||
it('rejects an empty or padded delete id before persistence', async () => {
|
||||
const test = await harness()
|
||||
for (const id of ['', ' schedule-1']) {
|
||||
expect(value(await execute(test, 'schedule_delete', { id }))).toEqual({
|
||||
code: 'invalid_rule',
|
||||
message: 'schedule_delete id must be non-empty without surrounding whitespace.',
|
||||
})
|
||||
}
|
||||
expect(test.flushes.count).toBe(0)
|
||||
})
|
||||
|
||||
it('returns a range error only after the create preflight', async () => {
|
||||
const test = await harness()
|
||||
expect(value(await execute(test, 'schedule_create', {
|
||||
|
||||
Reference in New Issue
Block a user