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:
yilsemandClaude Opus 5.5 committed 2026-10-11 01:23:07 +03:00
1 parent 1e2b8e2b9c
commit e2793fa38f
7 files changed
+129 -32

No files matched your search

@@ -32,8 +32,11 @@ class Ek(unittest.TestCase):
flat = {"type": "error", "code": "bad_request", "status_code": 400, "message":
'[400]: {"error":{"message":"This model does not support tool calls.","code":"tool_choice_unsupported"}}'}
out = feed(flat, hedef="m", aracsiz=seen.append)
self.assertEqual(out[0]["type"], "response.failed")
self.assertIn("araç çağrısını desteklemiyor", out[0]["response"]["error"]["message"])
# A permanent error ends the turn with a visible answer instead of a silent retry.
self.assertEqual([e["type"] for e in out], ["response.output_item.added", "response.output_text.delta",
"response.output_item.done", "response.completed"])
self.assertIn("araç çağrısını desteklemiyor", out[1]["delta"])
self.assertEqual(out[2]["item"]["phase"], "final_answer")
self.assertEqual(seen, ["m"])
home = tempfile.mkdtemp()
self.assertTrue(pencere.ogren_aracsiz(home, "m"))