expensify session expired mid-run for the audit agent: auth error
Recovers audit agents from expired Expensify sessions with re-authentication and resume. Use when an agent's Expensify session expires mid-run. Not for wrong credentials at login.
TL;DR
The Expensify session died mid-run. Detect the session failure, re-authenticate through the normal sign-in flow, and resume the audit from the checkpoint; do not restart the whole run.
Error
expensify session expired mid-run for the audit agentSteps
- Detect session expiry: watch for authentication failures or redirect-to-login responses. Expected: the agent identifies the session death.
- Re-authenticate using the stored sign-in flow (credentials from the secure store, never hard-coded). Expected: a fresh authenticated session.
- Verify the new session with a lightweight API call before resuming work. Expected: confirmed authentication.
- Resume from the last checkpoint. Expected: the audit continues where it stopped.
- Shorten the gap: refresh the session proactively on long runs before the known session lifetime ends. Expected: fewer mid-run expiries.
When to use
- An agent's Expensify session expires during a run.
- The failure appears as logouts or auth errors mid-run.
When not to use
- Login fails at the start (check the stored credentials).
- The account is locked (resolve with the Expensify admin).
Tool compatibility
- Expensify API and session handling; custom audit agents.
Variant phrasings
Expensify logged the agent out mid-run
Same failure, plain wording.
Session invalid during expense audit
The generic phrasing.
Why it happens
Expensify sessions have finite lifetimes for security. Agents that hold one session across a multi-hour audit will see it die underneath them.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstun8wVPdUeP6COp2G3e7ag