fix(gateway): prevent cleanup scripts from destroying shared resources - #1954
Merged
EashanKaushik merged 1 commit intoAug 24, 2026
Merged
Conversation
Two cleanup script bugs: 1. **waf/cleanup.py** calls `admin.delete_gateway(gateway_id)` which deletes ALL targets on the gateway and the gateway itself. But the WAF tutorial only creates one target on an existing shared gateway. Fix: only delete the specific target (via TARGET_ID from .env). 2. **semantic-search/cleanup.py** calls `admin.delete_gateway()` which internally deletes targets then immediately tries to delete the gateway. Target deletion is asynchronous — the gateway delete fails with "Gateway has targets associated". Fix: explicitly delete targets, poll until they're gone, then delete the gateway. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
|
EashanKaushik
approved these changes
Aug 24, 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.
Summary
Two cleanup scripts have destructive bugs when used with shared gateways:
1.
scripts/waf/cleanup.py— deletes entire gateway instead of its own targetdeploy.pyaccepts an existingGATEWAY_IDand creates a single target on itcleanup.pycallsadmin.delete_gateway()which deletes all targets and the gateway itselfTARGET_IDstored in.env2.
scripts/semantic-search/cleanup.py— race condition on gateway deletionadmin.delete_gateway()which deletes targets then immediately attempts gateway deletionValidationException: Gateway has targets associatedlist_gateway_targetsuntil empty (up to 2 min), then delete gatewayTest plan
🤖 Generated with Claude Code