From f36056ba6c0e63418798d54463d02d0c8fd84ac2 Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Sun, 1 Mar 2026 06:47:58 +0000 Subject: [PATCH 1/2] Initial plan From ae4cb58ae1d35d4e958c386fd60f3dcc8f6ec810 Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Sun, 1 Mar 2026 06:52:09 +0000 Subject: [PATCH 2/2] fix: update calendash oauth flow --- README.md | 2 +- scripts/calendash-api.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d066004..3eb2684 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ python3 -m pip install google-api-python-client google-auth-oauthlib python-dote ### First run (OAuth) -Run once manually to complete OAuth2 login and create `token.json` in the repo root: +Run once manually to complete OAuth2 login (local server flow) and create `token.json` in the repo root. When prompted, open the printed `http://localhost:/` URL in a browser on the same machine (or via SSH port forwarding), approve access, and wait for the terminal to confirm the token was saved: ```sh python3 scripts/calendash-api.py diff --git a/scripts/calendash-api.py b/scripts/calendash-api.py index fe88371..35f34c1 100755 --- a/scripts/calendash-api.py +++ b/scripts/calendash-api.py @@ -109,12 +109,16 @@ def get_credentials(client_id: str, client_secret: str, token_path: Path) -> Cre save_credentials(creds, token_path) return creds - logging.info("Starting first-run OAuth flow (console mode).") + logging.info("Starting first-run OAuth flow.") flow = InstalledAppFlow.from_client_config( build_client_config(client_id, client_secret), SCOPES, ) - creds = flow.run_console() + try: + creds = flow.run_local_server(port=0, open_browser=False) + except Exception as exc: + logging.info("Local server auth failed (%s); falling back to console flow.", exc) + creds = flow.run_console() save_credentials(creds, token_path) return creds