Skip creds gateway duplication check for one time auth #1449
+25
−18
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.
🐛 Bug-fix PR
📌 Summary
Closes #1448
Duplicate gateway checks used URL and credentials, but with one-time auth the credentials are always None, causing false duplicate errors. When one-time auth is enabled, the logic is updated to skip the duplicate check and enforce only name uniqueness, otherwise the original full duplicate logic was used.
🔁 Reproduction Steps
🐞 Root Cause
The duplicate-gateway validation logic considered a gateway a duplicate when both its URL and stored credentials matched an existing gateway.
However, when one-time authentication is enabled, credentials are not persisted and always evaluate to None.
As a result:
This creates a false-positive duplicate error.
💡 Fix Description
The fix updates the gateway duplicate detection logic to be conditional based on the authentication mode:
When one-time auth is enabled
When one-time auth is NOT enabled:
This ensures:
🧪 Verification
make lintmake testmake coverage📐 MCP Compliance (if relevant)
✅ Checklist
make black isort pre-commit)