The bug that only showed up once a week
My assistant kept losing its Google login every seven days. The fix turned out to be one setting.
Every week, like clockwork, Marvin lost access to my Google account and I had to log it back in by hand. I assumed I'd broken something on the server. I hadn't.
When you build your own app that connects to Google, it starts out in "testing" mode — and in testing mode, Google only trusts the login for seven days. Totally reasonable for a test. Terrible for an assistant that's supposed to run on its own.
Switching the app to "production" fixed it. To do that, Google wanted a homepage and a privacy policy, so this website now hosts a privacy page for my AI assistant. Not where I expected that afternoon to go.
A Google Cloud OAuth app whose consent screen is in Testing issues refresh tokens that expire seven days after consent. For a headless agent, that's a silent, scheduled outage.
Publishing to "In production" as an unverified app removes the expiry; you get a one-time "unverified app" warning at consent. It required a homepage and privacy policy URL, plus the domain verified in Search Console with a DNS TXT record (my DNS lives in Netlify).
gog auth add <you>@gmail.com \ --services gmail,calendar \ --readonly --force-consent
Bigger lesson: a bug on a fixed interval is almost never your code. It's a timer somewhere — certificates, tokens, cron jobs, leases. Start by asking "what expires?"