From 9214afb20697a4926ef02bae419909642d058500 Mon Sep 17 00:00:00 2001 From: Ryan Chen Date: Mon, 12 Oct 2026 22:42:37 -0400 Subject: [PATCH] Keep Google service enabled when token mount is read-only token.json is mounted :ro, so writing refreshed creds back raised PermissionError at startup once the stored access token expired. The broad except in agents.py then disabled Calendar and Gmail tools entirely. Keep the refreshed creds in memory when the write fails. Co-Authored-By: Claude Opus 5.5 --- utils/google_service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/google_service.py b/utils/google_service.py index 0859cfc..110d27b 100644 --- a/utils/google_service.py +++ b/utils/google_service.py @@ -25,8 +25,11 @@ class GoogleService: creds = Credentials.from_authorized_user_file(token_path, SCOPES) if creds.expired and creds.refresh_token: creds.refresh(Request()) - with open(token_path, "w") as f: - f.write(creds.to_json()) + try: + with open(token_path, "w") as f: + f.write(creds.to_json()) + except OSError: + pass # read-only mount; refreshed creds live in memory self._creds = creds self._calendar = build("calendar", "v3", credentials=creds) -- 2.52.0