fix(codex-link): summarize with a subscription model, reject tiny summaries, describe added models
Model switch lost the conversation: on 10 Oct a 1 MB thread was compacted by the newly selected small model into 2201 characters. The compaction summary for a bridge model is now written by a subscription model (ozet_kopru.ozet_modeli, default gpt-6.1-sol); if that request is refused before it starts, the target model is used as before. A summary far shorter than the conversation warrants is not accepted: Codex gets response.failed and keeps the history. The line under each added model no longer repeats its name. Teams show their members, fallback chains their order, single models their provider and the traits readable from the name; the text fits one phone row (30 characters). Also normalizes tool call ids in the streamed response so Codex persists ids the subscription backend accepts (fc_ -> ctc_), and bumps the bridge protocol to 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ce49d6d1cc
commit
adf73eeedd
7 files changed
+248
-13
No files matched your search
@@ -109,6 +109,31 @@ class Akis(unittest.TestCase):
|
||||
a = o.OzetAkisi()
|
||||
self.assertEqual(o.ozet_metni(coz(a.feed(ham))[1]["item"]), "ozet metni")
|
||||
|
||||
def test_anormal_kisa_ozet_gecmisin_yerine_konmaz(self):
|
||||
# 10 Ekim 2026: 1.018.151 baytlik sohbet 2201 karaktere indi; bu ozet kabul edilmemeli.
|
||||
self.assertEqual(o.en_az_karakter(1018151), 4000)
|
||||
self.assertEqual(o.en_az_karakter(100000), 400)
|
||||
self.assertEqual(o.en_az_karakter(0), 0)
|
||||
self.assertEqual(o.en_az_karakter(1018151, {"en_az_tavan": 1500}), 1500)
|
||||
ham = sse({"type": "response.created", "response": {"id": "r1"}},
|
||||
{"type": "response.output_item.done", "item": self._mesaj("k" * 2201)},
|
||||
{"type": "response.completed", "response": {"id": "r1", "status": "completed"}})
|
||||
a = o.OzetAkisi(tohum="7", en_az=o.en_az_karakter(1018151))
|
||||
olaylar = coz(a.feed(ham) + a.flush())
|
||||
self.assertEqual([e["type"] for e in olaylar], ["response.created", "response.failed"])
|
||||
self.assertNotIn("compaction", json.dumps(olaylar))
|
||||
self.assertEqual(olaylar[1]["response"]["error"]["code"], "astrabridge_ozet_kisa")
|
||||
self.assertTrue(a.kisa)
|
||||
self.assertIn("REDDEDILDI", a.sonuc_notu())
|
||||
# Yeterli uzunlukta ozet ayni esikle kabul edilir; kucuk sohbetin kisa ozeti de reddedilmez.
|
||||
for metin, esik in (("u" * 4000, o.en_az_karakter(1018151)), ("kisa ama dogru ozet", o.en_az_karakter(3000))):
|
||||
b = o.OzetAkisi(tohum="8", en_az=esik)
|
||||
ham2 = sse({"type": "response.output_item.done", "item": self._mesaj(metin)},
|
||||
{"type": "response.completed", "response": {"id": "r2"}})
|
||||
cikti = coz(b.feed(ham2))
|
||||
self.assertEqual(o.ozet_metni(cikti[0]["item"]), metin)
|
||||
self.assertFalse(b.kisa)
|
||||
|
||||
def test_metin_yoksa_compaction_uretilmez_hata_gorunur(self):
|
||||
ham = sse({"type": "response.created", "response": {}},
|
||||
{"type": "response.output_item.done", "item": {"type": "function_call", "name": "x"}},
|
||||
|
||||
Reference in new issue
Block a user