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 <noreply@anthropic.com>
This commit is contained in:
@@ -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())
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user