openclaw / openclaw/gogcli

groups list 400 INVALID_ARGUMENT: searchTransitiveGroups rejects `(A || B)` OR label filter

Open Beginner friendly
#1,059 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clawsweeper:needs-live-repro impact:other issue-rating: 🐚 platinum hermit P2
Dominant language
Go
Stars
8.4k
Forks
697
Avg merge
15h 39m
Merged PRs (30d)
89

Description

Environment

  • gog version: v0.38.1 (324f656a 2026-08-26T04:37:04Z)
  • Auth: delegated service account (domain-wide delegation), invoked as --account <workspace-email>

Repro

gog --account admin@example.com groups list

Result:

Google API error (400 badRequest): Request contains an invalid argument.

Root cause

internal/cmd/groups.gosearchTransitiveGroupsQuery builds this query:

return fmt.Sprintf(
    "member_key_id == '%s' && ('%s' in labels || '%s' in labels)",
    memberKeyID,
    groupLabelDiscussionForum, // cloudidentity.googleapis.com/groups.discussion_forum
    groupLabelDynamic,         // cloudidentity.googleapis.com/groups.dynamic
)

Cloud Identity's groups.memberships.searchTransitiveGroups query accepts && (AND) filters, but the parenthesized || (OR) between two label conditions is rejected with 400 INVALID_ARGUMENT.

Evidence (raw API, varying the query)

query HTTP
member_key_id == 'x@example.com' (no label) 400
member_key_id == 'x@example.com' && 'cloudidentity.googleapis.com/groups.discussion_forum' in labels 200
member_key_id == 'x@example.com' && ('...discussion_forum' in labels || '...dynamic' in labels) 400

Suggested fix

Use a single label filter instead of the OR (e.g. only discussion_forum), or issue two separate queries and merge results. The two-label OR appears to have been introduced by the label-filter change (#315), but the OR form is not accepted by the Cloud Identity API.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/cmd/groups.go at searchTransitiveGroupsQuery and reproduce with gog --account admin@example.com groups list. Check the Cloud Identity query constraints and choose between a single supported label filter or two queries with merged results. Done means the groups list request no longer returns 400 INVALID_ARGUMENT and still finds the intended groups.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, google-cloud
Domain
api, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.