fix(codex-bridge): audit findings: visible permanent errors, stricter model command, unbuffered stream
From ten independent read-only audits (11 Oct 2026), verified against the code: - a permanent gateway error (no tools, 401/402/403, bare upstream 400) ends the turn with a visible assistant message instead of a silent retry and an empty turn; - "modeli ... yapma", "X modeli için test yap" and general "hangi model ..." questions are no longer commands; a name whose version does not fit, or that several models share, is asked back; - the stream is forwarded as it arrives (read1) and an upstream drop is no longer logged as a client stop nor saved as an interrupted answer; - a lone "." joining a running turn is removed without the hook messages after it; - the interrupted-answer note finds the user message behind hook messages and detects completion by event type; a per-minute rate limit is not learned as a context window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1e2b8e2b9c
commit
e2793fa38f
7 files changed
+129
-32
No files matched your search
@@ -146,12 +146,22 @@ def kapali_hata_mi(metin):
|
||||
return bool(re.fullmatch(r"\s*upstream 4(?:00|13)\s*", metin or "", re.I))
|
||||
|
||||
|
||||
_HIZ_SINIRI = re.compile(r"per minute|rate.?limit|tokens? per|\bTPM\b|\b429\b|too many requests", re.I)
|
||||
|
||||
|
||||
def hiz_siniri_mi(metin):
|
||||
"""Dakikalik hiz siniri hatasi baglam tasmasi degildir ("rate limit of 32768 tokens per minute")."""
|
||||
return bool(_HIZ_SINIRI.search(metin or ""))
|
||||
|
||||
|
||||
def tasma_mi(metin):
|
||||
return bool(_TASMA.search(metin or ""))
|
||||
return bool(_TASMA.search(metin or "")) and not hiz_siniri_mi(metin)
|
||||
|
||||
|
||||
def sinir_oku(metin):
|
||||
"""Hedefin tasma hatasindaki gercek sinir; yoksa None."""
|
||||
if hiz_siniri_mi(metin):
|
||||
return None
|
||||
for kalip in _SINIR:
|
||||
m = kalip.search(metin or "")
|
||||
if m and int(m.group(1)) >= TABAN:
|
||||
|
||||
Reference in new issue
Block a user