mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 20:40:52 +08:00
fix: use underscore suffix in short name mapping
Replace the "~<n>" suffix with "_<n>" when generating unique short names in codex translators (Claude, Gemini, OpenAI chat). This avoids using a special character in identifiers, improving compatibility with downstream APIs while preserving length constraints.
This commit is contained in:
@@ -310,7 +310,7 @@ func buildShortNameMap(names []string) map[string]string {
|
||||
}
|
||||
base := cand
|
||||
for i := 1; ; i++ {
|
||||
suffix := "~" + strconv.Itoa(i)
|
||||
suffix := "_" + strconv.Itoa(i)
|
||||
allowed := limit - len(suffix)
|
||||
if allowed < 0 {
|
||||
allowed = 0
|
||||
|
||||
Reference in New Issue
Block a user