Skip to content

fix: validate gateway group membership before mutations - #17

Merged
ScriptedAlchemy merged 2 commits into
ScriptedAlchemy:mainfrom
davefmurray:fix/gateway-group-validation
Sep 15, 2026
Merged

ScriptedAlchemy merged 2 commits into
ScriptedAlchemy:mainfrom
davefmurray:fix/gateway-group-validation

Conversation

@davefmurray

Copy link
Copy Markdown
Contributor

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: 2e6d835

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
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/gateway-group-validation branch from d9fd656 to 11afc3e Compare September 15, 2026 00:50
Match store error priority: add/remove report "is a bot, not a group"
even when the member ref is missing.
@ScriptedAlchemy
ScriptedAlchemy merged commit 9b034ce into ScriptedAlchemy:main Sep 15, 2026
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.

2 participants