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
Review: _ensure_authenticated() early return may mask auth failures
The new guard in google_api.py:
def_ensure_authenticated():
ifTOKEN_PATH.exists() or_gws_binary():
return# ... original error + sys.exit(1) ...
Issue:_gws_binary() only checks whether the gws CLI binary is installed (via shutil.which), not whether it is authenticated. When gws is installed but has no valid credentials (no token at ~/.hermes/google_token.json and no native gws credential store), this function returns silently. Downstream code then attempts a real API call via gws, which fails with a less actionable error than the original "Not authenticated. Run the setup script first" message.
Suggested fix: Gate on actual authentication rather than binary presence. For example:
def_ensure_authenticated():
ifTOKEN_PATH.exists():
returnif_gws_binary() and_check_gws_native_auth(quiet=True):
returnprint("Not authenticated. Run the setup script first:", file=sys.stderr)
print(f" python {Path(__file__).parent/'setup.py'}", file=sys.stderr)
sys.exit(1)
This way, a gws binary with no credentials still surfaces the actionable setup message.
Separately: this PR shares the same google_api.py / prompt_builder.py TERMINAL_CWD fix territory as #24985 and #24957 — worth confirming the intended overlap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area/configConfig system, migrations, profilescomp/cronCron scheduler and job managementcomp/gatewayGateway runner, session dispatch, deliveryP2Medium — degraded but workaround existstype/bugSomething isn't working
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Plan
Note: full macOS gateway service suite had 6 unrelated systemd preflight failures on this host.