Skip to content

fix: validate gateway group membership before mutations - #17

Open
davefmurray wants to merge 1 commit into
ScriptedAlchemy:mainfrom
davefmurray:fix/gateway-group-validation
Open

fix: validate gateway group membership before mutations#17
davefmurray wants to merge 1 commit into
ScriptedAlchemy:mainfrom
davefmurray:fix/gateway-group-validation

Conversation

@davefmurray

Copy link
Copy Markdown

Gateway group commands currently skip the membership validation already enforced by the file backend. For example, gbot --gateway groups add Launch Launch sends a nested-group mutation, and removing the last member sends an empty membership list. Repeated references to the same bot are also sent as duplicate IDs, while the CLI advertises a six-member limit that gateway mode does not enforce.

This change resolves and deduplicates members before enforcing the existing one-to-six-bot rule, rejects nested groups, and rejects bot targets for group membership changes. Validation runs before createGroup or setGroupMembers mutations; add/remove inherit it through the existing set path. Includes a patch changeset.

Validation:

  • 17 gateway tests cover create/set/add/remove, alias deduplication at the six-member boundary, invalid memberships, invalid targets, and successful mutations. 14 fail against the original implementation.
  • npm test: 41 passed.
  • Node 18 compatibility suite: 41 passed.
  • npx --yes publint@0.3.24: passed.
  • Packed, installed into a temporary prefix, and ran gbot --help: passed.
  • git diff --check: passed.

Gateway responses are mocked; no live account mutations were performed.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d9fd656

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
grok-bot-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@davefmurray
davefmurray marked this pull request as ready for review September 5, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant