From 8faaad68ee5bb8244e5d0ea28f1939f301a5b365 Mon Sep 17 00:00:00 2001 From: Lexirieru Date: Wed, 11 Nov 2026 15:50:32 +0700 Subject: [PATCH 1/2] fix(engine): a Notion row change is checked before the card, not only before writing The full suite saw the model pass an invented row id ("row-renew-domain" for r14) and the owner got an approval card for a row that doesn't exist; execute refused it after Approve. The row checks (exists, title, archived, types, old values) now run in beforeApproval too, like the calendar move, so no card is shown for a change that can't happen and the model is told to read again. Tests: typecheck; test:unit 169/169 (new: invented id, wrong title, changed value refused before a card); skills-notion-update live 3/3; k6 load/chat.js 2 VUs 20 s. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e --- engine/CLAUDE.md | 2 +- engine/src/apps.ts | 50 ++++++++++++++++++++++++++-------------- engine/test/apps.test.ts | 16 ++++++++++--- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/engine/CLAUDE.md b/engine/CLAUDE.md index 0502f0aa..4f82a069 100644 --- a/engine/CLAUDE.md +++ b/engine/CLAUDE.md @@ -46,7 +46,7 @@ AI engine: a Mastra server that runs each Mind (soul, skills, tools, memory, sch - **Changing Sheets cells (#245, `googlesheets_update_cells` in `src/apps.ts`):** `GOOGLESHEETS_VALUES_UPDATE` (schema read live 11 Nov, version `20261101_00`), RAW values, `auto_expand_sheet: false`, `requireApproval` and a #167 switch. Arguments `range` (must name the tab), `newValues`, `oldValues` (named `newValues`, not `values`: beside `oldValues` the model wrote `newValues` itself and failed validation once). The playbook reads the cells first and passes them as `oldValues`, so the card shows Now and New; `execute` reads the range again and refuses (`status: "refused"`) if it no longer matches, and `beforeApproval` refuses an all-empty write (a clear, which stays closed). `googlesheets_read_range` returns `firstRow` and `rowNumbers`: counting rows itself, the model once picked INV-13's cell for INV-12 (both read "Unpaid"). Live test with a fake Composio: `test/skills-sheets-update.test.ts` (7/7 runs after the fixes); not tried on a real sheet. - **Adding to a Doc (#247 item 6, `googledocs_append_text` in `src/apps.ts`):** `GOOGLEDOCS_INSERT_TEXT_ACTION` (schema read live 11 Nov, version `20261101_00`), always `{ document_id, text_to_insert, append_to_end: true }` and nothing else (no `insertion_index`, `segment_id` or `tab_id`): the action only inserts text and has no argument that deletes or replaces. `GOOGLEDOCS_UPDATE_DOCUMENT_MARKDOWN` is not used: its `markdown` replaces the whole tab. `requireApproval` and a #167 switch. Arguments `documentId` (id or link, cut to the id), `title` (as `googledocs_read_document` returned it, shown on the card) and `text` (at most 10,000 characters, sent with a leading newline so it starts a new line). `execute` reads the Doc again and refuses (`status: "refused"`) if its title is not the one on the card. The playbook reads the Doc first and only adds text the owner asked for; text from emails, pages or Docs is never added on their say. Without "always read it first, a Drive name is not the title" the model once passed the Drive file name and skipped the read. Live test with a fake Composio: `test/skills-docs-append.test.ts`; not tried on a real Doc (where Composio puts the text, before or after the Doc's last newline, is not seen). - **Zoom (#246, `src/zoom.ts`, skill `zoom`):** toolkit `zoom` (Composio-managed OAUTH2, `GET /api/v3/toolkits/zoom` read live 11 Nov: 92 tools, version `20261105_00`) is in `TOOLKITS` and `App`; calls go through `appCall` (try-out refused, `NoActiveConnection` → "Zoom is not connected"). Tools: `zoom_list_meetings` (`ZOOM_LIST_MEETINGS`: `user_id: "me"`, `type` `upcoming` / `previous_meetings`, `page_size: 30`; sorted by us, ids as strings, `start_url` and passcodes never returned; each meeting carries `startLocal`/`endLocal` like the calendar tools), `zoom_create_meeting` (`requireApproval` + #167 switch; `ZOOM_CREATE_A_MEETING`: `user_id: "me"`, `type: 2`, `topic`, `start_time` in GMT (`…Z`), `timezone: "UTC"` (without it Zoom uses the account's zone), `duration`, optional `agenda`; the model's `start` must match `ISO_WITH_OFFSET` and `checkOwnerOffset`; nothing else is sent, so no guests, registrants, alternative hosts or settings: the schema's `settings.meeting_invitees` is free-form objects of undocumented effect) and `zoom_meeting_summary` (read only: `ZOOM_LIST_PAST_MEETING_INSTANCES` with the numeric `meetingId`, then `ZOOM_GET_A_MEETING_SUMMARY` with an instance UUID, the first and last two instances tried, latest wins; the list's `uuid` is the fallback when the instance list fails, since the managed app's scope list has no `meeting:read:list_past_instances`; an empty `summary_content` or any refusal is `status: "none"` with `NO_SUMMARY`). `src/zoom.ts` and `src/tools.ts` import each other (time zone helpers / registry): safe only while `tools.ts` loads first. Unit tests `test/zoom.test.ts`; live prompt test `test/skills-zoom.test.ts` (fake Composio, Asia/Jakarta, a fresh user per test so working memory from the summary test can't answer the no-summary one): 3/3 runs passed on 11 Nov. Nothing seen against a real Zoom account. -- **Notion database rows (#247 item 4, `notion_query_database`, `notion_update_row` in `src/apps.ts`):** schemas read live 11 Nov with `?version=latest` (`20261101_00`). `notion_query_database` (read only, no approval) calls `NOTION_QUERY_DATABASE_WITH_FILTER` (`database_id`, Notion's own `filter` object passed through, `sorts` by property, `page_size` ≤ 50 → `results[]` Notion page objects) and returns each row as `{ id, title, url, editedAt, properties: { : { type, value } } }`, values flattened to text by `notionValue` in the form the update takes (checkbox `True`/`False`, date `start` or `start/end`, multi_select `a, b`, status/select the option name); relation, rollup, files and other types are left out. `notion_update_row` (`requireApproval` and a #167 switch) takes `rowId`, `rowTitle` and `properties: [{ name, type, oldValue, newValue }]` (one list with both values per property, so the card pairs them without matching names); the playbook reads the row first and passes what it read, so the card shows old → new. `execute` re-reads the row with `NOTION_RETRIEVE_PAGE` and returns `status: "refused"` without writing if it is archived or in the trash, not a database row, its title is not `rowTitle`, a property is missing or of another type, or a value no longer matches `oldValue` (multi_select order, checkbox case and number form ignored). Then `NOTION_UPDATE_ROW_DATABASE` with `row_id`, `properties: [{ name, type, value }]` and always `delete_row: false` (that flag archives the row); `icon`/`cover` are never sent. Writable types are `notion_add_row`'s plus `status` (Notion's built-in Status property, which "mark it done" needs). An empty `newValue` is a clear: refused by `beforeApproval` (no card) and again in `execute`. Seen live (fake Composio): the model once sent `old-value`/`new-value` beside `oldValue`/`newValue`; Zod drops unknown keys before `execute`, but the card's args are the raw ones, so the FE and Telegram cards read only `oldValue`/`newValue`. Live test with a fake Composio: `test/skills-notion-update.test.ts` (due this week; mark the right one of two similar rows done; a row changed while the card waited is refused). Not tried on a real Notion database. +- **Notion database rows (#247 item 4, `notion_query_database`, `notion_update_row` in `src/apps.ts`):** schemas read live 11 Nov with `?version=latest` (`20261101_00`). `notion_query_database` (read only, no approval) calls `NOTION_QUERY_DATABASE_WITH_FILTER` (`database_id`, Notion's own `filter` object passed through, `sorts` by property, `page_size` ≤ 50 → `results[]` Notion page objects) and returns each row as `{ id, title, url, editedAt, properties: { : { type, value } } }`, values flattened to text by `notionValue` in the form the update takes (checkbox `True`/`False`, date `start` or `start/end`, multi_select `a, b`, status/select the option name); relation, rollup, files and other types are left out. `notion_update_row` (`requireApproval` and a #167 switch) takes `rowId`, `rowTitle` and `properties: [{ name, type, oldValue, newValue }]` (one list with both values per property, so the card pairs them without matching names); the playbook reads the row first and passes what it read, so the card shows old → new. `execute` re-reads the row with `NOTION_RETRIEVE_PAGE` and returns `status: "refused"` without writing if it is archived or in the trash, not a database row, its title is not `rowTitle`, a property is missing or of another type, or a value no longer matches `oldValue` (multi_select order, checkbox case and number form ignored). Then `NOTION_UPDATE_ROW_DATABASE` with `row_id`, `properties: [{ name, type, value }]` and always `delete_row: false` (that flag archives the row); `icon`/`cover` are never sent. Writable types are `notion_add_row`'s plus `status` (Notion's built-in Status property, which "mark it done" needs). An empty `newValue` is a clear: refused by `beforeApproval` (no card) and again in `execute`. Seen live (fake Composio): the model once sent `old-value`/`new-value` beside `oldValue`/`newValue`; Zod drops unknown keys before `execute`, but the card's args are the raw ones, so the FE and Telegram cards read only `oldValue`/`newValue`. Live test with a fake Composio: `test/skills-notion-update.test.ts` (due this week; mark the right one of two similar rows done; a row changed while the card waited is refused). Not tried on a real Notion database. Since 11 Nov the same checks (`rowRefusal`) also run in `beforeApproval`, so an invented row id, a wrong title or a changed value never gets a card (the full suite once saw the model pass "row-renew-domain" for `r14`). - **Free time and moving events (#247 item 3, `googlecalendar_find_free_time` and `googlecalendar_move_event` in `src/tools.ts`, helpers in `src/calendar.ts`), in `daily-planner` and `calendar-conflicts`.** Schemas read live 11 Nov with `?version=latest`, all version `20261110_00`. **Free time** (read only, no approval): `GOOGLECALENDAR_FIND_FREE_SLOTS` (`items: ["primary"]`, `time_min`/`time_max` ISO UTC, `timezone: "UTC"` → `data.calendars.primary.busy[]`/`free[]`, `is_reliable: false` when Google could not read the calendar, which we turn into an error, never "all free"). Its `free` gaps ignore length and time of day (nights count), so `freeSlots` works out the gaps from `busy` itself: at least `minutes` (15 to 480, default 60), only between `dayStart` and `dayEnd` (default 09:00 to 18:00) on the owner's clock (`zonedInstant`, Intl offsets, settles across a clock change), from now rounded up to the quarter hour; each slot carries `startLocal`/`endLocal`. Try-outs use `sampleBusy()` from `SAMPLE_CALENDAR`, no Composio. `GOOGLECALENDAR_FREE_BUSY_QUERY` gives the same busy list and was not needed. **Moving** (`requireApproval`, a #167 switch): **`GOOGLECALENDAR_PATCH_EVENT`, not `GOOGLECALENDAR_UPDATE_EVENT`**: UPDATE replaces the whole event ("omitted fields can be cleared", and its `create_meeting_room` defaults to true, which adds a Meet link); PATCH changes only what is sent. We send only `calendar_id: "primary"`, `event_id`, `start_time`, `end_time` (RFC3339 with offset) and `send_updates: "none"`, never `attendees`, so guests stay and nobody is emailed, guests or not. Arguments `eventId`, `title` (for the card), `oldStart`/`oldEnd` (the event's `start`/`end` exactly as `googlecalendar_list_events` gave them; the card shows From and To from them), `newStart`/`newEnd` (owner's offset, `checkOwnerOffset`, 1 min to 24 h). `beforeApproval` (it gets a plain object view of the request context, wrapped by `asContext`) reads the event with `GOOGLECALENDAR_EVENTS_GET` and refuses before any card (`status: "refused"`) when the time is unchanged, the event is not at the old time (compared as instants), is cancelled or all-day, the owner is not its organizer (`organizer.self` is left out unless true), or the read fails; `execute` reads it again just before writing (a card shown a while ago, or a rule that skipped it). The result has `guests` (count) and `guestsEmailed: false` so the Mind can say the owner may want to tell them. Recurring events: the list uses `singleEvents`, so ids are instance ids and only that occurrence moves (from Google's docs on the schema, not seen live). Try-outs move a `SAMPLE_CALENDAR` event on paper (`moveSampleEvent`, refused if it is not at the old time), nothing saved. Live test with a fake Composio: `test/skills-calendar-move.test.ts` (3/3 runs on 11 Nov: list first, card with old and new time, nothing written before approve, a stale event refused on approve, free time asks nothing). Not tried against a real Google Calendar. - **Calendar conflict check (#192, skill `calendar-conflicts`):** `get_time` + `googlecalendar_list_events` once, reports overlaps and zero-gap pairs, suggests moves (a slot from `googlecalendar_find_free_time` since #247), and changes nothing unless the owner asks: then `googlecalendar_move_event` (approval) or `googlecalendar_create_event` for a buffer. `SAMPLE_CALENDAR` has one overlap (`demo-cal-7` inside `demo-cal-3`) and one back-to-back pair (`demo-cal-4` → `demo-cal-8`). - **Thread titles (#86, `src/titles.ts`):** on a thread's first run (no Mastra thread with that id yet), `makeTitle` asks `config.titleModel` (`z-ai/glm-5.3-flash`, the cheapest Confidential TEE chat model, through the same verified transport) for a 3 to 6 word title of the first message. It starts *before* the run, so it is usually ready when the run ends, and is sent as `thread.titled` `{ threadId, title }` after `run.finished` and before `run.verified`. It never throws: a failure or the 30 s limit means no event, and the backend keeps the first-message cut. GLM sometimes reasons ~300 tokens on a one-word message (26 s measured for "tes" on 9 Nov), so keep `titleMaxOutputTokens` and `titleTimeoutMs` generous. The title call is not part of the run's verification. diff --git a/engine/src/apps.ts b/engine/src/apps.ts index d5a83518..1f70444b 100644 --- a/engine/src/apps.ts +++ b/engine/src/apps.ts @@ -414,6 +414,28 @@ type RowUpdate = { rowId: string; rowTitle: string; properties: { name: string; const refusedRow = (rowId: string, message: string) => ({ source: 'notion', rowId, url: '', updated: [] as string[], status: 'refused' as const, message }) const clearsSomething = ({ properties }: RowUpdate) => properties.some((p) => !p.newValue.trim()) +// The checks a row change must pass, before the card and again just before writing: the row must still be the one, +// and hold what, the owner sees on the card. Returns the page when it passes. +async function rowRefusal(context: Ctx, input: RowUpdate): Promise<{ page: any } | { message: string }> { + const { rowId, rowTitle, properties } = input + if (clearsSomething(input)) return { message: NOTION_CLEAR_REFUSED } + if (new Set(properties.map((p) => p.name)).size !== properties.length) return { message: 'not changed: each property may be listed once.' } + const page = unwrap(await appCall(context, 'notion', 'NOTION_RETRIEVE_PAGE', { page_id: rowId })) + if (!page?.id && !page?.properties) return { message: `not changed: there is no row with the id "${rowId}". Use the id notion_query_database returned.` } + if (page.archived === true || page.in_trash === true) return { message: 'not changed: that row is archived or in the trash.' } + if (page.parent?.type && !['database_id', 'data_source_id'].includes(page.parent.type)) return { message: 'not changed: that page is not a row of a database.' } + const title = notionTitle(page) + if (!sameText(title, rowTitle)) return { message: `not changed: that row is "${title}", not "${rowTitle}". Read the database again and ask the owner once more.` } + for (const p of properties) { + const current = page.properties?.[p.name] + if (!current) return { message: `not changed: the row has no property "${p.name}". Use the exact names notion_query_database returned.` } + if (current.type !== p.type) return { message: `not changed: "${p.name}" is a ${current.type} property, not ${p.type}.` } + const now = notionValue(current) + if (!sameValue(p.type, now, p.oldValue)) return { message: `not changed: "${p.name}" no longer holds the value shown for approval (now ${JSON.stringify(now)}). Read the row again and ask the owner once more.` } + } + return { page } +} + const notionUpdateRow = createTool({ id: 'notion_update_row', description: 'Change properties of one existing row in a Notion database (e.g. mark a task Done, move its due date). Waits for the owner to approve, unless one of the owner\'s rules covers it. First read the row with notion_query_database, then pass its id as rowId, its title as rowTitle, and for each property you change its name, type, oldValue exactly as read, and newValue as text in the same form ("Done", "2026-11-14", "True"). Only the listed properties change. It cannot clear a property, archive or delete a row.', @@ -430,24 +452,18 @@ const notionUpdateRow = createTool({ outputSchema: z.object({ source: z.string(), rowId: z.string(), url: z.string(), updated: z.array(z.string()), status: z.enum(['updated', 'refused']), message: z.string().optional() }), requireApproval: true, // Refused before the owner ever sees a card: an empty new value is a clear. - beforeApproval: (input) => clearsSomething(input) ? { proceed: false, output: refusedRow(input.rowId, NOTION_CLEAR_REFUSED) } : undefined, + // No card for a change that can't happen: checked before the card (an invented row id once got a card, 11 Nov, full + // suite: the model passed "row-renew-domain" for r14) and again in execute (the row may change while the card waits). + beforeApproval: async (input, { requestContext }) => { + const view = requestContext as Record | undefined + const refusal = await rowRefusal({ requestContext: { get: (k: string) => view?.[k] } } as Ctx, input).catch((e) => ({ message: `not changed: ${e instanceof Error ? e.message : String(e)}` })) + return 'message' in refusal ? { proceed: false, output: refusedRow(input.rowId, refusal.message) } : undefined + }, execute: async (input, context) => { - const { rowId, rowTitle, properties } = input - if (clearsSomething(input)) return refusedRow(rowId, NOTION_CLEAR_REFUSED) - if (new Set(properties.map((p) => p.name)).size !== properties.length) return refusedRow(rowId, 'not changed: each property may be listed once.') - // The row must still be the one, and hold what, the owner saw on the card. - const page = unwrap(await appCall(context, 'notion', 'NOTION_RETRIEVE_PAGE', { page_id: rowId })) - if (page.archived === true || page.in_trash === true) return refusedRow(rowId, 'not changed: that row is archived or in the trash.') - if (page.parent?.type && !['database_id', 'data_source_id'].includes(page.parent.type)) return refusedRow(rowId, 'not changed: that page is not a row of a database.') - const title = notionTitle(page) - if (!sameText(title, rowTitle)) return refusedRow(rowId, `not changed: that row is "${title}", not "${rowTitle}". Read the database again and ask the owner once more.`) - for (const p of properties) { - const current = page.properties?.[p.name] - if (!current) return refusedRow(rowId, `not changed: the row has no property "${p.name}". Use the exact names notion_query_database returned.`) - if (current.type !== p.type) return refusedRow(rowId, `not changed: "${p.name}" is a ${current.type} property, not ${p.type}.`) - const now = notionValue(current) - if (!sameValue(p.type, now, p.oldValue)) return refusedRow(rowId, `not changed: "${p.name}" no longer holds the value shown for approval (now ${JSON.stringify(now)}). Read the row again and ask the owner once more.`) - } + const { rowId, properties } = input + const checked = await rowRefusal(context, input) + if ('message' in checked) return refusedRow(rowId, checked.message) + const page = checked.page const data = unwrap(await appCall(context, 'notion', 'NOTION_UPDATE_ROW_DATABASE', { row_id: rowId, properties: properties.map(({ name, type, newValue }) => ({ name, type, value: newValue })), delete_row: false, })) diff --git a/engine/test/apps.test.ts b/engine/test/apps.test.ts index c7e482bb..abc10603 100644 --- a/engine/test/apps.test.ts +++ b/engine/test/apps.test.ts @@ -59,7 +59,7 @@ const answers: Record unknown> = { NOTION_INSERT_ROW_DATABASE: () => ok({ id: 'row1', url: 'https://www.notion.so/row1' }), // #247: a task list, as Notion's page objects (the latest output schema); r3 is archived and must not show. NOTION_QUERY_DATABASE_WITH_FILTER: () => ok({ object: 'list', type: 'page_or_database', has_more: true, results: [TASK, { ...TASK, id: 'r3', archived: true }] }), - NOTION_RETRIEVE_PAGE: (a) => ok(a.page_id === 'gone' ? { ...TASK, id: 'gone', in_trash: true } : a.page_id === 'pg' ? { ...TASK, id: 'pg', parent: { type: 'page_id', page_id: 'x' } } : { ...TASK, id: a.page_id }), + NOTION_RETRIEVE_PAGE: (a) => a.page_id === 'made-up' ? { result_type: 'failed', error: 'object_not_found', data: {} } : ok(a.page_id === 'gone' ? { ...TASK, id: 'gone', in_trash: true } : a.page_id === 'pg' ? { ...TASK, id: 'pg', parent: { type: 'page_id', page_id: 'x' } } : { ...TASK, id: a.page_id }), NOTION_UPDATE_ROW_DATABASE: (a) => ok({ object: 'page', id: a.row_id, url: `https://www.notion.so/${a.row_id}` }), OUTLOOK_LIST_MESSAGES: () => ok({ value: [{ id: 'AAMk1', subject: 'Invoice', bodyPreview: 'Please pay\nby Friday', receivedDateTime: '2026-11-10T02:00:00Z', isRead: false, from: { emailAddress: { name: 'Lumen Billing', address: 'billing@lumenhost.example' } } }] }), OUTLOOK_GET_MESSAGE: (a) => ok({ id: a.message_id, subject: 'Invoice', receivedDateTime: '2026-11-10T02:00:00Z', from: { emailAddress: { address: 'billing@lumenhost.example' } }, @@ -274,9 +274,19 @@ test('notion: change a row after re-reading it; never archives; a changed, wrong // Clearing: refused by beforeApproval (no card) and again in execute, before Composio is called at all. calls.length = 0 const tool = (toolRegistry as any).notion_update_row - const before = await tool.beforeApproval(one({ newValue: ' ' }), {}) + const view = { requestContext: { [USER_KEY]: 'usr_a' } } + const before = await tool.beforeApproval(one({ newValue: ' ' }), view) assert.deepEqual([before.proceed, before.output.status], [false, 'refused']) - assert.equal(await tool.beforeApproval(one({}), {}), undefined) + assert.equal(calls.length, 0, 'a clear is refused before Composio is called') + assert.equal(await tool.beforeApproval(one({}), view), undefined) + // An invented row id, a wrong title or a changed value gets no card at all (11 Nov: the model once passed + // "row-renew-domain" and the owner saw a card for a row that doesn't exist). + for (const [input, why] of [[one({}, { rowId: 'made-up' }), /not changed/], [one({}, { rowTitle: 'Something else' }), /not "Something else"/], [one({ oldValue: 'Done' }), /no longer holds/]] as const) { + const r = await tool.beforeApproval(input, view) + assert.equal(r?.proceed, false, JSON.stringify(input)) + assert.match(r.output.message, why) + } + calls.length = 0 assert.equal((await run('notion_update_row', one({ newValue: '' }))).status, 'refused') assert.equal(calls.length, 0) // Read-only types and archive-like fields are not in the schema. From 14978f7eec88b65d85e9498d10b287d092e9fc5f Mon Sep 17 00:00:00 2001 From: Lexirieru Date: Wed, 11 Nov 2026 15:50:32 +0700 Subject: [PATCH 2/2] test(engine): the sample calendar check reads the list call that ran The full suite failed once when the model's first googlecalendar_list_events call failed validation (Mastra answers { error: true } as a tool.result) and the second call ran. The test now checks the call that ran; alone it passed 3/3 before and after. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e --- engine/test/engine.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/test/engine.test.ts b/engine/test/engine.test.ts index 4efc8af1..06ac6828 100644 --- a/engine/test/engine.test.ts +++ b/engine/test/engine.test.ts @@ -377,7 +377,9 @@ describe('engine HTTP API', () => { test('a try-out run reads the sample calendar on the googlecalendar App node', async () => { const evs = await events(await post('/v1/minds/cal/chat', { userId, threadId: randomUUID(), demo: true, mind: planner, message: 'What is on my calendar this week? Use googlecalendar_list_events.' })) - const listed = evs.find((e) => e.type === 'tool.result' && e.tool === 'googlecalendar_list_events') + // The model sometimes sends arguments that fail validation first and calls again (Mastra answers `{ error: true }` + // as a tool.result; seen once in the full suite, 11 Nov): the call that ran is the one to check. + const listed = evs.find((e) => e.type === 'tool.result' && e.tool === 'googlecalendar_list_events' && e.result?.error !== true) assert.ok(listed, JSON.stringify(evs.filter((e) => e.tool))) assert.equal(listed.nodeId, 'app:googlecalendar') assert.equal(listed.result.source, 'sample_calendar')