mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix: strip trailing _copy before appending to avoid accumulation
Addresses Greptile feedback: duplicating Server_copy no longer creates Server_copy_copy; instead it stays Server_copy. https://claude.ai/code/session_01Wx49QQnsCngnJ7hsfaC1yC
This commit is contained in:
parent
b3229bc2e5
commit
bba52fa969
1 changed files with 3 additions and 2 deletions
|
|
@ -297,9 +297,10 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
|
|||
setTransportType(transport);
|
||||
|
||||
const copySuffix = "_copy";
|
||||
const baseName = duplicateServer.server_name || duplicateServer.alias || "";
|
||||
const baseName = (duplicateServer.server_name || duplicateServer.alias || "").replace(/_copy$/, "");
|
||||
const baseAlias = (duplicateServer.alias || duplicateServer.server_name || "").replace(/_copy$/, "");
|
||||
const newName = baseName + copySuffix;
|
||||
const newAlias = (duplicateServer.alias || baseName) + copySuffix;
|
||||
const newAlias = baseAlias + copySuffix;
|
||||
|
||||
const prefillValues: Record<string, any> = {
|
||||
server_name: newName,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue