fix(add-gmail): graceful startup when credentials missing + poll backoff

- connect() warns and returns instead of throwing when ~/.gmail-mcp/
  credentials are missing, preventing app crash
- index.ts wraps gmail.connect() in try/catch as a safety net
- Poll loop uses exponential backoff on consecutive errors (caps at 30m)
  instead of hammering the Gmail API every 60s on auth failures
- Switch from setInterval to setTimeout chain for proper backoff timing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-02-25 00:23:11 +02:00
parent 695ff08f4c
commit 8e164f608c
2 changed files with 30 additions and 14 deletions

View File

@@ -452,7 +452,11 @@ async function main(): Promise<void> {
const gmail = new GmailChannel(channelOpts);
channels.push(gmail);
await gmail.connect();
try {
await gmail.connect();
} catch (err) {
logger.warn({ err }, 'Gmail channel failed to connect, continuing without it');
}
// Start subsystems (independently of connection handler)
startSchedulerLoop({