Skip to content

fix: require gateway when creating a gateway target#469

Merged
aidandaly24 merged 2 commits intofeat/gateway-integrationfrom
fix/gateway-target-requires-gateway
Feb 27, 2026
Merged

fix: require gateway when creating a gateway target#469
aidandaly24 merged 2 commits intofeat/gateway-integrationfrom
fix/gateway-target-requires-gateway

Conversation

@tejaskash
Copy link
Contributor

@tejaskash tejaskash commented Feb 27, 2026

Summary

  • A gateway target must always be attached to a gateway. Previously users could create "unassigned" targets by selecting "Skip for now" in the TUI or omitting --gateway in non-interactive mode
  • Validation now requires --gateway, verifies the specified gateway exists, and errors early if no gateways are configured — with a helpful message directing users to agentcore add gateway first
  • The TUI gateway selection step no longer offers a "Skip for now" option; the existing NoGatewaysMessage blocks the flow when no gateways exist
  • The operations layer (createExternalGatewayTarget) rejects a missing gateway, removing the unassignedTargets code path

Test plan

  • validate.test.ts — 3 new tests: missing --gateway, no gateways exist, specified gateway not found
  • create-mcp.test.ts — replaced unassigned-target tests with "throws when gateway not provided"
  • All existing gateway target tests updated to include gateway field and pass
  • Manual: run agentcore add gateway-target without a gateway configured → should error
  • Manual: run agentcore add gateway-target --gateway nonexistent → should list available gateways
  • Manual: TUI flow no longer shows "Skip for now" in gateway selection

A gateway target must always be attached to a gateway. Previously it was
possible to create unassigned targets via "Skip for now" in the TUI or
by omitting --gateway in non-interactive mode.

- Validation now requires --gateway and verifies the gateway exists
- TUI removes the "Skip for now" option from gateway selection
- createExternalGatewayTarget rejects missing gateway at operations layer
- Updated tests to cover all new validation paths
@github-actions github-actions bot added the size/m PR size: M label Feb 27, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Feb 27, 2026
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 46.41% 3267 / 7038
🔵 Statements 46.01% 3444 / 7484
🔵 Functions 47.83% 663 / 1386
🔵 Branches 50.89% 2157 / 4238
Generated in workflow #782 for commit 4591082 by the Vitest Coverage Report Action

Copy link
Contributor

@aidandaly24 aidandaly24 left a comment

Choose a reason for hiding this comment

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

approved very clean change thank you

@aidandaly24 aidandaly24 merged commit c6c3fc8 into feat/gateway-integration Feb 27, 2026
13 of 15 checks passed
@aidandaly24 aidandaly24 deleted the fix/gateway-target-requires-gateway branch February 27, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants