Conversation
…S resources remove-all only reset agentcore.json, leaving mcp.json untouched. This caused gateways to survive removal, and subsequent deploys would keep gateway resources alive in AWS instead of triggering teardown. Changes: - handleRemoveAll (CLI path): reset mcp.json gateways after writeProjectSpec - useRemoveFlow (TUI path): reset mcp.json gateways + enumerate gateways/targets in the confirmation list - Add test verifying mcp.json gateways are cleared during remove-all Fixes GW-08
tejaskash
approved these changes
Mar 3, 2026
tejaskash
added a commit
that referenced
this pull request
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
remove -> Allonly resetagentcore.json, leavingmcp.jsonuntouched. This caused gateway resources (Gateway, Gateway Target, IAM Role) to survive removal — subsequentagentcore deploysawhasGateways=true, skipped teardown, and kept gateway resources alive in AWS.This PR adds
mcp.jsongateway cleanup to both the CLI and TUI remove-all paths:handleRemoveAll()(CLI): resetsmcp.jsongateways afterwriteProjectSpec()useRemoveFlow()(TUI): resetsmcp.jsongateways inrunRemoval()+ enumerates gateways/targets in the confirmation list so users see what's being removedNo changes to preflight, teardown, or CDK logic — the existing teardown detection already works correctly once
mcp.jsonis cleared.Related Issue
Documentation PR
N/A — no user-facing docs changes needed. The behavior now matches what users already expect.
Type of Change
Testing
How have you tested the change?
Added a new test in remove-all.test.ts that writes mcp.json with a gateway and target, runs
remove all --force --json, and verifiesagentCoreGatewaysis cleared to an empty array. All 1892 unit tests pass with 0 failures.Also manually tested creating a gateway, gateway target, agent. I deployed these resources, then did remove all, and it worked.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.