fix(schedule): narrow persistence error operation
This commit is contained in:
@@ -103,6 +103,12 @@ describe('Schedule tool protocol', () => {
|
||||
const test = await harness()
|
||||
expect(['schedule_create', 'schedule_list', 'schedule_delete'].map(name => test.ctx.tools.get(name)?.name))
|
||||
.toEqual(['schedule_create', 'schedule_list', 'schedule_delete'])
|
||||
const outputSchema = test.ctx.tools.get('schedule_create')?.output.schema as {
|
||||
oneOf?: Array<{ properties?: { code?: { const?: string }; operation?: { enum?: string[] } } }>
|
||||
}
|
||||
const persistenceError = outputSchema.oneOf?.find(schema =>
|
||||
schema.properties?.code?.const === 'persistence_uncertain')
|
||||
expect(persistenceError?.properties?.operation?.enum).toEqual(['create', 'list', 'delete'])
|
||||
for (const name of ['schedule_create', 'schedule_list', 'schedule_delete']) {
|
||||
expect(test.ctx.tools.executionMode({ signal, callId: CallId(name), name, arguments: {}, agent: test.agent }))
|
||||
.toEqual({ kind: 'exclusive' })
|
||||
|
||||
Reference in New Issue
Block a user