You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: google_api.py crashes on Python 3.9 — missing from __future__ import annotations #16257
google_api.py is missing from __future__ import annotations, causing a TypeError on Python 3.9 (macOS system python) due to PEP 604 union syntax (str | None).
PR #15405 added the future import to setup.py but missed google_api.py, which uses str | None on lines 82 and 95.
This requires Python 3.10+. On 3.9, from __future__ import annotations makes it parse correctly (annotations become strings, not evaluated). PR #15405 commit 2ffcc57 added this to setup.py but not google_api.py.
Proposed Fix
One-liner — add after the shebang, before the module docstring:
from __future__ importannotations
Same pattern already applied in setup.py and _hermes_home.py.
Related to PR #15158 (same root cause: missing from __future__ import annotations for PEP 604 syntax). #15158 fixed setup.py but missed google_api.py. Also related to PR #13765 (bulk future annotations fix across 112 files).
Heads up — this is already fixed in open PR #15158, which adds from __future__ import annotations to both hermes_constants.py and skills/productivity/google-workspace/scripts/google_api.py.
The _gws_binary() -> str | None annotation on line 82 (and any others) will work on Python 3.9 once that PR merges. No separate fix needed.
One PR directly addresses issue #16257. #16272 adds postponed annotation evaluation to google_api.py, eliminating the reported Python 3.9 import-time TypeError, and applies the same fix to two bundled PowerPoint scripts with equivalent PEP 604 usage.
Merge #16272 after addressing the keep_open review through an explicit scope correction and executable Python 3.9 regression coverage; its diff directly fixes the reported cause and the two same-class bundled occurrences. There are no competing triaged PRs to close as duplicates.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I16257(["issue #16257 (open)"])
P16272["PR #16272 (open)"]
P16272 -->|best fix| I16257
class I16257 open
class I16257 target
class P16272 open
class P16272 best
click I16257 "https://github.com/NousResearch/hermes-agent/issues/16257"
click P16272 "https://github.com/NousResearch/hermes-agent/pull/16272"
Loading
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 1 kB of PR diffs, 3 kB of issue/PR text, 2 kB of discussion (4 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Confirming reproduction on this side too (macOS, system Python 3.9.6 reachable on PATH for terminal-tool-spawned subprocesses). PR #16272's file list doesn't cover skills/software-development/github/scripts/git-credential-token.py, which has the identical bug — filed separately as #125202 since it's a different skill, but flagging here in case #16272 wants to sweep it in too.
Fixed in #19. One thing worth flagging for anyone else picking this up: the one-line fix in the issue is not sufficient on current main.
google_api.py has a second, independent Python 3.9 blocker — line 36:
fromdatetimeimportdatetime, timedelta, timezone, UTC
datetime.UTC is a 3.11+ alias, so once the future import is in place the script still fails on 3.9, with a different error:
google_api.py: ImportError: cannot import name 'UTC' from 'datetime'
gws_bridge.py in the same directory has the same import. Replacing with timezone.utc (which UTC aliases) resolves it.
This is invisible to ast.parse, since PEP 604 is a runtime failure and UTC is an import — so a parse-only check reports the script as fixed while it still crashes.
Reproduced on real CPython 3.9.25, and confirmed the issue's diagnosis is exactly right for the original traceback: without the future import, L82 raises the reported TypeError.
Scope in #19: google_api.py, gws_bridge.py (UTC), git-credential-token.py (@kcs2092's find), and fetch_transcript.py (same annotation class, found by sweeping). All four go from failing to importing cleanly under 3.9. An AST sweep confirms no other bundled skill script has the annotation form of this bug.
#16272 aims to fix this: it adds the future annotations import to the Google Workspace API script so the union type hints no longer crash on Python 3.9.
Activity
alt-glitch commentedon Apr 27, 2026
Related to PR #15158 (same root cause: missing
from __future__ import annotationsfor PEP 604 syntax). #15158 fixed setup.py but missed google_api.py. Also related to PR #13765 (bulk future annotations fix across 112 files).briandevans commentedon Apr 27, 2026
Heads up — this is already fixed in open PR #15158, which adds
from __future__ import annotationsto bothhermes_constants.pyandskills/productivity/google-workspace/scripts/google_api.py.The
_gws_binary() -> str | Noneannotation on line 82 (and any others) will work on Python 3.9 once that PR merges. No separate fix needed.vominh1919 commentedon Apr 27, 2026
Submitted PR #16272 with a fix. Added
from __future__ import annotationsto all 3 affected skill scripts:google_api.py(primary)pack.py(powerpoint)add_slide.py(powerpoint)setup.pyalready had the import. The fix is zero-functional-change — PEP 604 annotations become lazy strings on Python 3.9.GottZ commentedon Jul 29, 2026
Summary
One PR directly addresses issue #16257. #16272 adds postponed annotation evaluation to google_api.py, eliminating the reported Python 3.9 import-time TypeError, and applies the same fix to two bundled PowerPoint scripts with equivalent PEP 604 usage.
Related pull requests
best fix— (+6/-0) — fixes: Addsfrom __future__ import annotationsto the reported Google Workspace script and two bundled PowerPoint scripts that share the same Python 3.9 failure mode. The keep_open review on fix(skills): add future annotations for Python 3.9 compatibility (#16257) #16272 correctly notes that the claimed sweep omits two optional-skill scripts and thatast.parsedoes not reproduce import-time annotation evaluation; narrow the stated scope to these three bundled scripts and add real Python 3.9 import/execution coverage before merging.Suggested consolidation
Merge #16272 after addressing the keep_open review through an explicit scope correction and executable Python 3.9 regression coverage; its diff directly fixes the reported cause and the two same-class bundled occurrences. There are no competing triaged PRs to close as duplicates.
Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I16257(["issue #16257 (open)"]) P16272["PR #16272 (open)"] P16272 -->|best fix| I16257 class I16257 open class I16257 target class P16272 open class P16272 best click I16257 "https://github.com/NousResearch/hermes-agent/issues/16257" click P16272 "https://github.com/NousResearch/hermes-agent/pull/16272"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 1 kB of PR diffs, 3 kB of issue/PR text, 2 kB of discussion (4 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
kcs2092 commentedon Sep 27, 2026
Confirming reproduction on this side too (macOS, system Python 3.9.6 reachable on PATH for terminal-tool-spawned subprocesses). PR #16272's file list doesn't cover
skills/software-development/github/scripts/git-credential-token.py, which has the identical bug — filed separately as #125202 since it's a different skill, but flagging here in case #16272 wants to sweep it in too.MuhammadUsamaMX commentedon Oct 18, 2026
Fixed in #19. One thing worth flagging for anyone else picking this up: the one-line fix in the issue is not sufficient on current
main.google_api.pyhas a second, independent Python 3.9 blocker — line 36:datetime.UTCis a 3.11+ alias, so once the future import is in place the script still fails on 3.9, with a different error:gws_bridge.pyin the same directory has the same import. Replacing withtimezone.utc(whichUTCaliases) resolves it.This is invisible to
ast.parse, since PEP 604 is a runtime failure andUTCis an import — so a parse-only check reports the script as fixed while it still crashes.Reproduced on real CPython 3.9.25, and confirmed the issue's diagnosis is exactly right for the original traceback: without the future import,
L82raises the reportedTypeError.Scope in #19:
google_api.py,gws_bridge.py(UTC),git-credential-token.py(@kcs2092's find), andfetch_transcript.py(same annotation class, found by sweeping). All four go from failing to importing cleanly under 3.9. An AST sweep confirms no other bundled skill script has the annotation form of this bug.alt-glitch commentedon Oct 18, 2026
#16272 aims to fix this: it adds the future annotations import to the Google Workspace API script so the union type hints no longer crash on Python 3.9.