fix(codex-link): keep subscription models untouched, append bridge models after them

sirala_codex re-sorted the whole list and rewrote every priority, which pushed the
native subscription models to the bottom and put same-named AITURK copies
(GPT-6-Astra) above them. Native models now keep their own order, priority and
name; bridge models are appended after them and a copy that shares a native name
is shown with an (AITURK) suffix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yilsemandClaude Opus 5.5 committed 2026-10-10 03:16:49 +03:00
1 parent 8ee676d7c6
commit ce49d6d1cc
2 files changed
+40 -8

No files matched your search

@@ -85,6 +85,7 @@ def ide_yapilandirma(agent=AGENT):
DOKUZ_ISARET = "9R · "
AITURK_EKI = " (AITURK)"
def _isaret(ad):
@@ -157,10 +158,18 @@ def sec(data, tanimli=(), kapsam="ide", turler=None):
def sirala_codex(modeller, ekler):
"""Tum listeyi siralar: combo A-Z, sonra saglayici A-Z / model A-Z.
Kimlik ve yetenek alanlari korunur; kayitli model secimine dokunulmaz.
Codex'in isDefault etiketi kendi davranisi geregi ilk gorunur satira verilir."""
"""Ozgun abonelik modelleri oldugu gibi kalir: sirasi, priority degeri ve adi degismez,
listenin basinda durur. Ek modeller onlarin ARKASINA eklenir: combo A-Z, sonra
saglayici A-Z / model A-Z. Ozgun bir modelle ayni adi tasiyan ek model " (AITURK)"
ekiyle ayirt edilir; secicide ozgunun yerine gecmis gibi gorunmez.
Kimlik ve yetenek alanlari korunur; kayitli model secimine dokunulmaz."""
bilgiler = {m["slug"]: m for m in ekler}
ozgunler = [m for m in modeller if m.get("slug", "") not in bilgiler]
ek_modeller = [m for m in modeller if m.get("slug", "") in bilgiler]
def yalin(ad): # "GPT-6-1-Sol" ile "GPT-6.1-Sol" ayni ad sayilir
return re.sub(r"[^0-9a-z]+", "", (ad or "").casefold())
ozgun_adlar = {yalin(m.get("display_name") or m.get("slug", "")) for m in ozgunler}
def anahtar(m):
slug = m.get("slug", "")
@@ -182,9 +191,14 @@ def sirala_codex(modeller, ekler):
saglayici, model = "OpenAI", ad
return (1, saglayici.casefold(), model.casefold(), slug)
modeller.sort(key=anahtar)
for n, model in enumerate(modeller):
model["priority"] = n
ek_modeller.sort(key=anahtar)
taban = max([m.get("priority") or 0 for m in ozgunler], default=-1) + 1
for n, model in enumerate(ek_modeller):
model["priority"] = taban + n
ad = model.get("display_name") or model.get("slug", "")
if yalin(ad) in ozgun_adlar:
model["display_name"] = f"{ad}{AITURK_EKI}"
modeller[:] = ozgunler + ek_modeller
def yukle(ua="AstraBridge/1.0 (codex)", timeout=30):