fix(codex-bridge): preserve tool model and stream preparation without Jev fallback

This commit is contained in:
yilsem committed 2026-10-11 15:51:43 +03:00
1 parent 8fbbe226db
commit 3726d2a553
6 files changed
+118 -14

No files matched your search

@@ -28,7 +28,20 @@ class AraTest(unittest.TestCase):
def test_search_output_and_empty_result(self):
metin = ara.ara("x", indirici=lambda adres: (SAYFA, "text/html"))
self.assertIn("1. Bir başlık\n https://ornek.com/bir?a=1", metin)
self.assertIn("Sonuç bulunamadı", ara.ara("x", indirici=lambda adres: ("<html></html>", "text/html")))
self.assertIn("Sonuç bulunamadı", ara.ara("x", indirici=lambda adres: ('<div class="no-results">no results</div>', "text/html")))
def test_bot_challenge_uses_one_rss_backup_not_false_no_results(self):
calls = []
def indirici(adres):
calls.append(adres)
return (('<form id="challenge-form">Bot challenge</form>' if len(calls) == 1 else
'<rss><channel><item><title>OmniRoute</title><link>https://ornek.com/</link></item></channel></rss>'), 'text/html')
self.assertIn('https://ornek.com/', ara.ara('OmniRoute', indirici=indirici))
self.assertEqual(len(calls), 2)
def test_two_invalid_services_report_failure_not_no_results(self):
with self.assertRaisesRegex(RuntimeError, 'Arama hizmeti'):
ara.ara('x', indirici=lambda adres: ('<html>challenge</html>', 'text/html'))
def test_page_is_turned_into_text_and_cut(self):
sayfa = "<html><head><style>a{}</style><script>x()</script></head><body><nav>menü</nav><p>Bir &amp; iki</p><div>üç</div></body></html>"
@@ -46,7 +59,8 @@ class InternetTest(unittest.TestCase):
betik = os.path.join(d, "ara.py")
open(betik, "w").close()
metin = internet.talimat(None, betik, python="py.exe")
self.assertIn(f'"py.exe" "{betik}" ara "sorgu"', metin)
on = '& ' if os.name == 'nt' else ''
self.assertIn(f'{on}"py.exe" "{betik}" ara "sorgu"', metin)
self.assertIn(f'"py.exe" "{betik}" oku <adres>', metin)
req = {"input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "araştır"}]}]}
self.assertTrue(internet.ekle(req, metin))