Blog

How to test an executive assistant agent across Google Calendar, Gmail and Slack

One Slack message, nine API calls and two people named Owen. What an assistant gets wrong while every call returns 200, and a test world built to catch it.

November 10, 2026 · Patrick Liu

On a Tuesday morning, Martha Quinn writes to her assistant in a private Slack channel: “Owen at Linwood wants to push Thursday’s check-in to next week. Can you find a time that works, move it and let him know?” Owen’s email is in her inbox. He suggested Tuesday or Wednesday afternoon. Her calendar has the check-in on Thursday at 10:00, with a Meet link, a one-line agenda and both of them marked as accepted.

For a person this is two minutes of work. For an agent it is nine API calls across three products. Ours makes two calls to Slack to find the request and two to Gmail to find Owen’s email. It makes three to Google Calendar: find the meeting, read Martha’s free time, move the event. Then it answers with one call to Gmail and one to Slack.

Any of those calls can return 200 while the job goes wrong. An agent that books Wednesday as a new event leaves Thursday’s in place, and Owen gets a second invitation. An agent searching the inbox for Owen answers whichever Owen wrote last. An agent on a UTC server that writes 13:00 as UTC books Martha at 5:00 AM Pacific. Nothing in the agent’s own log looks wrong.

Building a test world for this job taught us one thing above the rest. A calendar with one meeting and an inbox with one email cannot catch any of these mistakes, because there the shortcut and the right answer are the same. The world has to make the easy answer wrong. In ours, the newest email comes from a different Owen, the afternoon Owen named first is already taken, and the meeting carries details that a copy would lose. We build one of the replicas compared below, Ancha, and the three runs in this post use it.

Why Martha’s inbox has two Owens

Every record we seeded is there to make one shortcut fail.

The inbox holds two emails from an Owen. Owen Price of Linwood Capital wrote 50 minutes before the run to ask for the move. Owen Marsh of Marsh Equipment Leasing wrote 15 minutes before it, about the lease on Martha’s two warehouse forklifts. Martha’s message names “Owen at Linwood” and gives no address. An agent that searches for from:owen and keeps the top hit gets the newer email, from the wrong man. Take Owen Marsh out of the seed and that agent passes.

The calendar is full where Owen asked to meet. Next Tuesday, Martha is at the Reno branch from noon to 5:00. Next Wednesday she has lunch with the Sacramento branch managers until 1:00, then a pricing review at 3:00. Inside Owen’s window, the first free half hour is Wednesday at 1:00 PM. An agent that reads Tuesday afternoon off the email and books Tuesday at noon double-books her. One that asks Calendar for her busy times first finds the opening.

The meeting is worth moving rather than copying. It has a description, a Meet link and two guests who already accepted. A patch keeps all of that, because Calendar changes only the fields you send. A new event starts with whatever the agent remembered to put in it.

The request sits in a private channel, #martha-desk. Slack’s conversations.list returns public channels unless the call asks for private ones too. An agent written against the default call never sees Martha’s message at all.

None of this is unusual. Anyone busy enough to need an assistant has two contacts with the same first name and a week with no open afternoons. A world without them tests a quieter week than the one the agent will get.

Mocks, recordings, real accounts or a replica

Teams test an assistant like this in one of four ways.

ApproachCatchesMissesVendor accountTools
Mock the SDK clientsThe logic that turns Owen’s two afternoons into a slot, given busy times you hand it, and the text it writesWhatever you left out of the mock: a second Owen, the meeting that already existsNoThe mocks in Jest (30.5.2, September 2026), Vitest (5.1.0, November 2026) or Python’s unittest.mock
Fake or recorded HTTP APIsThe requests your SDKs send: times and zones, sendUpdates, the reply’s In-Reply-To header, thread_tsWhat a write changes. After the move, a recorded events.list still shows ThursdayNo; yes to recordMockoon (9.10.0, October 2026; samples for Calendar, Gmail and Slack), WireMock (3.13.2, November 2025), nock (15.0.6, November 2026), msw (3.0.4, November 2026), Polly.js (6.0.6, July 2023), vcrpy (9.4.2, November 2026)
Google’s and Slack’s own accountsOAuth consent and scopes, the invitation as a guest receives it, how the reply looks in Gmail and SlackA repeatable start: moved events, sent mail and posted messages stay behind after each runYes, a Google account and a Slack sandboxA Google Workspace trial with an OAuth app in testing, and a Slack developer sandbox
Stateful replicasWhat the agent left behind: the old event, the thread holding the reply, where the confirmation went. Every run starts from the same seeded weekNoAncha (all three), Baseline (all three), Arga Labs (all three), DrizzLabs (all three), vercel-labs/emulate (all three; Apache-2.0, 0.13.1, November 2026), Rystic (Gmail and Slack)

The versions and dates in the table come from each project’s page on npm, PyPI or GitHub, looked up on November 10, 2026, the day we recorded Martha’s runs.

Our advice is to split the work. The code that turns two afternoons into one slot is plain logic. Hand it busy times through a mock and it runs in milliseconds. A real Google account and a Slack sandbox are worth setting up once, to watch OAuth consent go through and to see the invitation arrive the way Owen would. Everything else in this post is one step reading what another step wrote: the free time behind the slot, the email behind the reply, the request behind the confirmation. That takes a world that keeps state and starts from the same Tuesday morning every run. A replica gives you that.

Can I use real Google and Slack accounts?

Yes. Google offers a 14-day Workspace trial at no cost. The agent signs in through an OAuth app, and while that app’s publishing status is Testing, Google allows up to 100 test users. Each test user’s authorization ends seven days after consent, refresh tokens included, so a test that runs weekly signs in again every week.

Slack’s developer sandboxes are free. Any developer can create a basic one without a paid plan or a payment method. You can keep two active at a time, with up to eight users each. By default a basic sandbox lasts one month and the others six.

Two things make these accounts awkward for tests you run often. First, they keep everything. After one run, the check-in sits on Wednesday, the reply sits in Owen’s thread and the confirmation sits in the channel. Someone has to put all three back before the next run. Second, they reach real people. When the agent moves a meeting with sendUpdates set to all, Google emails every guest about the change. Put addresses you own on the guest list, or each run sends a stranger an update about a meeting that never existed.

What should an executive assistant agent test check?

Five things are worth checking. None of the mistakes behind them produces an error, so each check looks at one of two places: the agent’s own calls, or what Calendar, Gmail and Slack hold once it is done.

There is one meeting, at the new time. Calendar has two ways to put a meeting at a new time, and only one of them moves it. events.patch edits the event that exists, and Google’s reference puts the rule plainly: “Fields that you don’t specify in the request remain unchanged.” events.insert creates a second event and leaves Thursday where it was. Deleting Thursday afterwards doesn’t repair it. With sendUpdates set to all, the delete sends every guest a cancellation and the insert sends them a fresh invitation. So the check reads the calls: it wants a PATCH on an event and no POST to the events collection, and a second check wants no DELETE.

The new time is free. Calendar answers availability through a separate call, freeBusy.query, which returns the busy blocks of the calendars you name. An agent that skips it picks a slot from the words in Owen’s email, and in this world that lands on the Reno visit or the Sacramento lunch. Read Martha’s calendar after the run and look for an overlap.

The time carries its zone. Each start and end needs a UTC offset or an explicit timeZone. An agent on a server set to UTC that writes 13:00:00Z makes a valid request, and the meeting lands at 5:00 AM Pacific. The response looks fine. Only the stored event shows the problem, so read its start back in Martha’s zone, America/Los_Angeles.

The reply reaches Owen Price, in his thread. Gmail’s query uses the search box syntax, and from:owen matches both men. Search by address. The reply then has to join his thread, which in Gmail takes three things: the request names the threadId, the In-Reply-To and References headers point at his message, and the subject matches. Miss one and Owen gets a new conversation instead of an answer. The check opens Owen Price’s thread after the run and expects a message labeled SENT.

The confirmation lands under Martha’s request. Slack puts a message in a thread only when you pass thread_ts, and the value has to be the first message’s ts. Slack’s reference tells you to avoid a reply’s ts and “use its parent instead.” Without it, the confirmation goes to the channel, away from the question it answers. The check looks in the thread of Martha’s message for a reply from the assistant.

Martha’s week as a world file

The world file seeds all three products as they stand on that Tuesday morning. This is the inbox:

gmail:
  mailboxes:
    - address: martha.quinn@pruittsupply.example
      messages:
        - ref: owen_price_move
          from: Owen Price <owen.price@linwoodcap.example>
          subject: Thursday's check-in
          body: "Hi Martha,\n\nSomething came up on Thursday. Could we move our
            check-in to next week? Tuesday or Wednesday afternoon both work for
            me.\n\nOwen"
          at: -50m
        - ref: owen_marsh_lease
          from: Owen Marsh <owen@marshequipment.example>
          subject: Forklift lease renewal
          body: "Hi Martha,\n\nThe lease on your two warehouse forklifts renews
            December 1. Do you want to keep both, or swap one for the electric
            model we talked about?\n\nOwen Marsh\nMarsh Equipment Leasing"
          at: -15m

And these are the four checks we wrote for it:

checks:
  - id: moved_not_rebooked
    trace:
      called: "PATCH /calendar/v3/calendars/*/events/*"
      not_called: "POST /calendar/v3/calendars/*/events"
  - id: no_meeting_deleted
    trace: { not_called: "DELETE /calendar/v3/calendars/*/events/*" }
  - id: answered_owen_price
    state: { gmail.thread: { of: owen_price_move, label: SENT } }
  - id: confirmed_in_martha_thread
    state: { slack.message: { channel: $desk, from: $assistant, in_thread_of: $ask } }

Two of them read the calls (trace). The other two open Gmail and Slack once the agent exits and look at what is there (state).

Before any agent runs, ancha check reports one pass and three failures. The pass is no_meeting_deleted, which an agent that does nothing also satisfies. A check like that guards against a mistake. It says nothing about whether the job got done, which is why the world requires all four.

The first run: a meeting booked twice

We wrote three scripted agents for this world, with no model, so each mistake happens in every trial. The first does the whole job and gets one step wrong. It finds the free half hour, Wednesday at 1:00 PM. Then, instead of moving Thursday’s event, it creates a new one with the same title and guests. It sends a POST to the events collection where the right agent sends a PATCH to the event. That is the only line that differs.

$ ancha run executive-assistant-world.yaml --local -n 3 --agent "node wrong-rebook-agent.mjs"
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-233026_680d93a552c02437: 3 trials of executive-assistant-world, 1 at a time
trial 1 ✗ 162ms · moved_not_rebooked failed
trial 2 ✗ 139ms · moved_not_rebooked failed
trial 3 ✗ 156ms · moved_not_rebooked failed

✗ executive-assistant-world  0/3 (0%)
    ✗ moved_not_rebooked  failed in 3/3 trials
      trial 1: The agent never made a call matching "PATCH /calendar/v3/calendars/*/events/*". Its calls were: POST /api/conversations.list, POST /api/conversations.history, GET /gmail/v1/users/me/messages, GET /gmail/v1/users/me/messages/1a1c63933c0c197d, GET /calendar/v3/calendars/primary/events, POST /calendar/v3/freeBusy, POST /calendar/v3/calendars/primary/events, POST /gmail/v1/users/me/messages/send, POST /api/chat.postMessage. The agent made 1 call(s) matching "POST /calendar/v3/calendars/*/events" that it must not make: POST /calendar/v3/calendars/primary/events (seq 7).

fail (minimum pass rate 100%)  run run_20261110-233026_680d93a552c02437

Calendar answered the insert with 200. After the run, Martha’s calendar has the check-in twice, Thursday at 10:00 and Wednesday at 1:00, and Owen has an invitation for each. The failure message lists all nine calls in order and points at the seventh, the POST.

The copy is also worse than the original in ways no check asked about. Our agent sent the title, the guests and the new times, and nothing else, so the agenda didn’t come along. On real Google Calendar the Meet link wouldn’t either: insert ignores conference data unless the request sets conferenceDataVersion to 1. And the agent copied the guest list exactly as events.list returned it, with Owen already marked as accepted. Google’s insert reference warns about this case. Depending on their invitation settings, such guests “might have their response reset to needsAction and won’t see an event in their calendar” until they answer the email. A meeting rebooked this way can be invisible to the one person it was moved for.

Everything else held in all three trials. The reply went to Owen Price, the confirmation went into Martha’s thread, and nothing was deleted. The fix is that one line: a PATCH on the existing event with the new start and end.

The second run: the wrong Owen

The second agent moves the meeting correctly. Its mistake is in the search. It asks Gmail for from:owen, gets both emails back, and takes the first, which is the newer one from Owen Marsh.

$ ancha run executive-assistant-world.yaml --local -n 3 --agent "node wrong-owen-agent.mjs"
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-233029_6d10140c9df6bfd6: 3 trials of executive-assistant-world, 1 at a time
trial 1 ✗ 144ms · answered_owen_price failed
trial 2 ✗ 135ms · answered_owen_price failed
trial 3 ✗ 135ms · answered_owen_price failed

✗ executive-assistant-world  0/3 (0%)
    ✗ answered_owen_price  failed in 3/3 trials
      trial 1: Expected the thread of owen_price_move in martha.quinn@pruittsupply.example has a message labelled SENT; found 1 message, none labelled SENT, 0 drafts.

fail (minimum pass rate 100%)  run run_20261110-233029_6d10140c9df6bfd6

From the agent’s side, this run went well. It searched, read one message, moved the meeting, sent a reply and confirmed in Slack, and every call returned 200. The reply went into Owen Marsh’s thread, under Re: Forklift lease renewal, and told Owen Marsh, who leases Martha her forklifts, that the check-in had moved. Owen Price heard nothing.

A check on the calls would struggle here. They match the right agent’s calls one for one, apart from the id of the message it read. The state check had no trouble. It opened Owen Price’s thread after the run and found one message, his own. The fix is to search by address: from:owen.price@linwoodcap.example.

With a model in place of the script, this mistake would come and go. A model might search by name in one trial and by address in the next. That is why every run here has three trials, and why the verdict is a pass rate.

Both fixes, three passes

$ ancha run executive-assistant-world.yaml --local -n 3
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-233023_e31b66fa9a155550: 3 trials of executive-assistant-world, 1 at a time
trial 1 ✓ 156ms
trial 2 ✓ 125ms
trial 3 ✓ 140ms

✓ executive-assistant-world  3/3 (100%)

pass (minimum pass rate 100%)  run run_20261110-233023_e31b66fa9a155550

Fixed in both places, the same script passes all three trials, each between 125 and 156 milliseconds. We wrote the two broken agents to test the checks, not the assistant. A check you have never seen fail might be checking nothing, and each of these failed on the one mistake it was written for and passed everywhere else. If your agent runs on a model, point --agent at it and raise -n. The world and the checks stay the same.

The replicas used here each have a page on this site: Google Calendar, Gmail and Slack.

Pointing Google’s and Slack’s clients at the world

The agent’s code doesn’t change between Martha’s real accounts and the world. Each official client has a setting for the address it talks to, and ancha connect shows the ones each SDK needs. In Node, the Google clients take a rootUrl with each call, and Slack’s WebClient takes slackApiUrl once:

import { auth, calendar } from '@googleapis/calendar';
import { gmail } from '@googleapis/gmail';
import { WebClient } from '@slack/web-api';

const oauth = new auth.OAuth2();
oauth.setCredentials({ access_token: process.env.GOOGLE_CALENDAR_ACCESS_TOKEN });
const cal = calendar({ version: 'v3', auth: oauth });
const options = { rootUrl: process.env.GOOGLE_CALENDAR_API_URL + '/' };
const { data } = await cal.events.list({
  calendarId: 'primary',
  q: 'Linwood',
  singleEvents: true,
  orderBy: 'startTime',
  timeMin: '2026-11-10T00:00:00-08:00'
}, options);

const mailAuth = new auth.OAuth2();
mailAuth.setCredentials({ access_token: process.env.GMAIL_ACCESS_TOKEN });
const mail = gmail({ version: 'v1', auth: mailAuth });
const found = await mail.users.messages.list(
  { userId: 'me', q: 'from:owen.price@linwoodcap.example' },
  { rootUrl: process.env.GMAIL_API_URL + '/', retry: false }
);

const slack = new WebClient(process.env.SLACK_BOT_TOKEN, {
  slackApiUrl: process.env.SLACK_API_URL
});
const { channels } = await slack.conversations.list({
  types: 'public_channel,private_channel'
});

In Python, google-api-python-client takes the endpoint through client_options, and for Calendar it ends in /calendar/v3/. slack_sdk’s WebClient takes base_url:

import os
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from slack_sdk import WebClient

cal = build(
    "calendar",
    "v3",
    credentials=Credentials(token=os.environ["GOOGLE_CALENDAR_ACCESS_TOKEN"]),
    client_options={
        "api_endpoint": os.environ["GOOGLE_CALENDAR_API_URL"] + "/calendar/v3/"
    },
)
events = (
    cal.events()
    .list(
        calendarId="primary",
        q="Linwood",
        singleEvents=True,
        orderBy="startTime",
        timeMin="2026-11-10T00:00:00-08:00",
    )
    .execute()
)

slack = WebClient(
    token=os.environ["SLACK_BOT_TOKEN"],
    base_url=os.environ["SLACK_API_URL"].rstrip("/") + "/"
)

We ran both snippets against this world in a clean sandbox, with the official packages from npm and PyPI. The calendar search found the Linwood check-in on Thursday at 10:00, the Gmail search by address found one message, and the channel list found #martha-desk. Note the types argument in the Node call: without private_channel, Slack leaves Martha’s channel out of the list.

Running Martha’s week yourself

Download executive-assistant-world.yaml into a fresh folder. Ancha’s CLI runs on Node.js 24.

npm install -g @ancha-labs/cli
ancha world up --scene executive-assistant-world.yaml

The command prints a URL and fake credentials for each product: GOOGLE_CALENDAR_API_URL and GOOGLE_CALENDAR_ACCESS_TOKEN, GMAIL_API_URL and GMAIL_ACCESS_TOKEN, SLACK_API_URL and SLACK_BOT_TOKEN, plus the task in ANCHA_TASK. Hand them to your agent however it reads configuration, run it once, then ask for the verdict:

ancha check --env <world id>
ancha world down --env <world id>

For three trials from the same Tuesday morning, let Ancha start it:

ancha init --agent "node agent.mjs"
ancha run executive-assistant-world.yaml --local -n 3

Questions

How do I move a Google Calendar event through the API?

Call events.patch on the existing event with the new start and end, each with a UTC offset or a timeZone. Patch changes only the fields you send, so the guests, the description and the Meet link stay. Add sendUpdates=all if the guests should get an email about the change. events.insert would create a second event and leave the first one where it was.

Is a Slack developer sandbox free?

Yes. Slack says its developer sandboxes come at no additional cost, and any developer can create a basic sandbox without a paid plan or a payment method. You can keep two active at a time, with up to eight users in each.

How long does a Google OAuth app in testing keep its access?

Seven days from the user’s consent. While an app’s publishing status is Testing, Google ends each test user’s authorization after a week, refresh tokens included, and allows up to 100 test users. A test that runs weekly has to sign in again every time.

Does Google Workspace have a free trial?

Yes. Google’s Workspace pricing page offers 14 days at no cost.