Skip to content

Regression: gws auth login -s chat requests no Chat scope in v0.22.5 (dynamic Discovery fallback from #236/#352 not firing) #822

@nakaumin

Description

@nakaumin

Summary

On v0.22.5, gws auth login -s chat does not include any Google Chat OAuth scope in the consent request or the saved credentials. This is a regression of #236, which was fixed in 0.10.0 by the dynamic Discovery-scope fallback (PR #352 / #246, commit 06aa698).

A service that is in the static scope list (e.g. drive) resolves correctly, so the failure is isolated to services that depend on the dynamic fallback path.

Environment

  • gws version: 0.22.5 (latest)
  • OS: macOS
  • Account: personal @gmail.com (also reproduced on a Google Workspace account)
  • Chat API enabled in the GCP project
  • OAuth client: Desktop app

Steps to reproduce

  1. GOOGLE_WORKSPACE_CLI_LOG=gws=debug gws auth login -s chat
  2. Complete the browser consent.
  3. Inspect the consent URL scope= param and the saved scopes.

Actual behavior (-s chat)

No Chat scope — only cloud-platform + identity scopes:

"scopes": [
  "https://www.googleapis.com/auth/cloud-platform",
  "openid",
  "https://www.googleapis.com/auth/userinfo.email",
  "https://www.googleapis.com/auth/userinfo.profile"
]

Control: -s drive (service in the static list) works

"scopes": [
  "https://www.googleapis.com/auth/drive",
  "https://www.googleapis.com/auth/cloud-platform",
  "openid",
  "https://www.googleapis.com/auth/userinfo.email",
  "https://www.googleapis.com/auth/userinfo.profile"
]

Same version, same account, same flow — only the service name differs. drive (static list) resolves; chat (dynamic fallback) does not.

Expected behavior

-s chat should add a Chat scope (e.g. https://www.googleapis.com/auth/chat.messages), as intended by #236 / #352.

Related observations (Chat scope is unreachable via every normal path)

On v0.22.5, no standard path yields a Chat scope:

  • gws auth login -s chat → no Chat scope (the regression above)
  • gws auth login (no -s) → no Chat scope
  • interactive scope picker → Chat is not listed as a selectable option

The only working path is passing the full scope URL explicitly:

gws auth login --scopes "https://www.googleapis.com/auth/chat.messages"

This succeeds and yields correct Chat access.

I'm reporting -s chat as the core bug because it's a clear regression of #236. Whether the no-flag default and the picker are supposed to include Chat may be a separate design question, but in practice all paths currently fail, leaving the explicit --scopes URL as the only way to obtain Chat access.

Note on debug logging

With GOOGLE_WORKSPACE_CLI_LOG=gws=debug, no Discovery-fetch log lines are emitted during auth login, so I could not confirm from logs whether the fallback runs and returns empty, or is never invoked. Either way, no Chat scope is produced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions