fix(codex-link): only reject degenerate summaries, not short correct ones

The size-proportional minimum (input/250, cap 4000) rejected a correct summary:
a 646,955 byte thread (225k tokens, five labelled facts in a long log) was
summarized by the subscription model in 1501-1701 characters, the bridge demanded
2587, and Codex could not continue the thread on the selected model. The floor now
only catches broken output (input/2000, cap 300). Memory loss is prevented by who
writes the summary, not by its length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yilsemandClaude Opus 5.5 committed 2026-10-10 15:52:44 +03:00
1 parent 94e4aa2a74
commit 9739222919
2 files changed
+16 -10

No files matched your search

@@ -51,11 +51,13 @@ KISA_MESAJI = ("AstraBridge: Sohbet ozeti cok kisa cikti (%d karakter, en az %d
def en_az_karakter(girdi_bayt, ayar=None):
"""Bu buyuklukteki bir konusmanin ozeti en az kac karakter olmali.
Olcu: 10 Ekim 2026'da 1.018.151 baytlik sohbet 2201 karaktere indi ve hafiza kayboldu.
Kucuk sohbetlerde esik kuculur ki kisa ama dogru ozetler reddedilmesin."""
Yalniz bozuk/bos sayilacak kadar kisa ozeti yakalar; ozetin yeterliligini boyuttan cikarmaz.
Olcum (10 Ekim 2026, 646.955 baytlik gunluk + bes olgu): guclu modelin dogru ozeti 1500-1700
karakterdi; boyuta oranli yuksek esik (2587) bu dogru ozeti reddedip sohbeti kilitledi.
Hafiza kaybinin asil onlemi ozeti guclu modele yazdirmaktir (bridge.py _ozet_openai)."""
ayar = ayar or {}
tavan = int(ayar.get("en_az_tavan", 4000))
oran = max(1, int(ayar.get("en_az_oran", 250))) # her 250 bayt girdi icin 1 karakter
tavan = int(ayar.get("en_az_tavan", 300))
oran = max(1, int(ayar.get("en_az_oran", 2000))) # her 2000 bayt girdi icin 1 karakter
return max(0, min(tavan, int(girdi_bayt) // oran))