Adds the IDE's models and combos to Codex's model list and keeps conversation summaries readable across providers, so switching models in Codex no longer drops the conversation. Standard-library Python, run on the agent venv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRDGW1LiKcDUZYUdKBoWYW
46 lines
1.7 KiB
Python
46 lines
1.7 KiB
Python
"""claude_sonu_duzelt testleri (9Router Claude prefill 400)."""
|
|
import ast
|
|
import json
|
|
from pathlib import Path
|
|
import unittest
|
|
|
|
tree = ast.parse(Path(__file__).with_name("bridge.py").read_text(encoding="utf-8"))
|
|
env = {}
|
|
exec(compile(ast.Module(body=[n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == "claude_sonu_duzelt"], type_ignores=[]), "bridge.py", "exec"), env)
|
|
f = env["claude_sonu_duzelt"]
|
|
|
|
|
|
def msg(role, text="x"):
|
|
return {"type": "message", "role": role, "content": [{"type": "input_text", "text": text}]}
|
|
|
|
|
|
class ClaudeSonu(unittest.TestCase):
|
|
def test_asistanla_biten_duzelir(self):
|
|
req = {"input": [msg("user"), msg("assistant")]}
|
|
self.assertTrue(f(req)[0])
|
|
self.assertEqual(req["input"][-1]["role"], "user")
|
|
|
|
def test_asistan_sonra_developer_duzelir(self):
|
|
# Sesli tur kapaninca: ... assistant, developer (9Router developer'i dusurur -> asistanla biter)
|
|
req = {"input": [msg("user"), msg("assistant"), msg("developer")]}
|
|
self.assertTrue(f(req)[0])
|
|
self.assertEqual(req["input"][-1]["role"], "user")
|
|
|
|
def test_reasoning_ile_biten_duzelir(self):
|
|
req = {"input": [msg("user"), {"type": "reasoning", "id": "rs_1"}]}
|
|
self.assertTrue(f(req)[0])
|
|
|
|
def test_kullaniciyla_biten_degismez(self):
|
|
req = {"input": [msg("assistant"), msg("user"), msg("developer")]}
|
|
self.assertFalse(f(req)[0])
|
|
self.assertEqual(len(req["input"]), 3)
|
|
|
|
def test_arac_sonucuyla_biten_degismez(self):
|
|
req = {"input": [msg("user"), {"type": "custom_tool_call", "call_id": "c"}, {"type": "custom_tool_call_output", "call_id": "c"}]}
|
|
self.assertFalse(f(req)[0])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|
|
|