Skip to content

fix: remove dead --agents flag from add gateway#711

Merged
jesseturner21 merged 1 commit intoaws:mainfrom
aidandaly24:fix/remove-dead-agents-flag-from-gateway
Mar 27, 2026
Merged

fix: remove dead --agents flag from add gateway#711
jesseturner21 merged 1 commit intoaws:mainfrom
aidandaly24:fix/remove-dead-agents-flag-from-gateway

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

Remove the dead --agents CLI flag from agentcore add gateway. The flag was registered on the Commander command, included in type definitions, and passed through the action handler, but was never consumed by buildGatewayConfig(), never validated by validateAddGatewayOptions(), and the AddGatewayConfig type had no agents field. A user passing --agents my-agent1,my-agent2 would have their input silently discarded.

This was a leftover from an earlier design where gateways were associated with specific agents. The current architecture wires all gateways to all agents via wireGatewayUrlsToAgents() in the CDK constructs — there is no per-gateway agent association.

Changes:

  • Removed --agents option registration from Commander (GatewayPrimitive.ts)
  • Removed agents?: string from both AddGatewayOptions interfaces (primitive + CLI types)
  • Removed agents: cliOptions.agents passthrough in the action handler
  • Removed --agents documentation row from commands.md
  • Added regression test confirming --agents is now properly rejected

Related Issue

N/A — dead code cleanup discovered during code review

Documentation PR

N/A — only removed a doc row for a non-functional flag

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Test results: 216/218 test files pass. 2 pre-existing failures in tui-harness/__tests__/proof-of-concept.test.ts (PTY/xterm wiring — unrelated). All 9 gateway-specific tests pass including the new regression guard.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

The --agents CLI option was registered on the `add gateway` command but
never wired into the gateway creation logic. buildGatewayConfig() never
read options.agents, validateAddGatewayOptions() never validated it, and
AddGatewayConfig had no agents field. A user passing --agents would have
their input silently discarded.

Remove the flag from CLI registration, type definitions, action handler
passthrough, and documentation. Add a regression test confirming the
flag is now properly rejected.

Constraint: Current architecture wires all gateways to all agents via wireGatewayUrlsToAgents
Rejected: Deprecation warning cycle | zero known consumers, flag was never functional
Confidence: high
Scope-risk: narrow
@aidandaly24 aidandaly24 requested a review from a team March 27, 2026 21:23
@github-actions github-actions Bot added the size/xs PR size: XS label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.3.0-preview.9.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-711-tarball/aws-agentcore-0.3.0-preview.9.0.tgz

Copy link
Copy Markdown
Contributor

@jesseturner21 jesseturner21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice

@jesseturner21 jesseturner21 merged commit c1c41ca into aws:main Mar 27, 2026
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants