Skip to content

fix: wire gateway-target CLI flags and default source to existing-endpoint#488

Open
aidandaly24 wants to merge 1 commit intomainfrom
fix/gateway-target-cli-flags
Open

fix: wire gateway-target CLI flags and default source to existing-endpoint#488
aidandaly24 wants to merge 1 commit intomainfrom
fix/gateway-target-cli-flags

Conversation

@aidandaly24
Copy link
Contributor

Description

Fixes three bugs in the gateway-target CLI non-interactive path that made agentcore add gateway-target non-functional from the CLI:

Source code fixes:

  • command.tsx: Wire source, type, and endpoint options through to the handler (were silently dropped, making --source existing-endpoint --endpoint <url> non-functional from CLI)
  • validate.ts: Default source to 'existing-endpoint' when not provided, matching TUI behavior (only supported path currently)
  • validate.ts: Reject --source create-new with a clear error message instead of falling through to unimplemented code
  • validate.ts: Move outbound auth validation before source-specific branching so credential/OAuth checks apply to existing-endpoint targets (was unreachable due to early return)

After this fix, agentcore add gateway-target --name foo --endpoint https://example.com/mcp --gateway bar --json works as expected. Test coverage follows in a separate PR.

Related Issue

Closes #

Documentation PR

N/A

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

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.

…point

- Pass source/type/endpoint options through command.tsx to handler
  (were silently dropped, breaking --source existing-endpoint)
- Default source to 'existing-endpoint' in validation (only supported path)
- Reject 'create-new' source with clear error message
- Move outbound auth validation before source branching so it applies
  to existing-endpoint targets (was unreachable due to early return)
@aidandaly24 aidandaly24 requested a review from a team March 3, 2026 20:09
@github-actions github-actions bot added the size/s PR size: S label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant