Wire authenticated voice watch notices through an owned native launcher
This commit is contained in:
1 parent
eeee2756c7
commit
b66d9164ad
23 files changed
+1981
-10
No files matched your search
@@ -164,7 +164,7 @@ class Ozet(unittest.TestCase):
|
||||
|
||||
class Akis(unittest.TestCase):
|
||||
env = build(top("fix_tool_ids", "SseRewriter", "phase_damgala", "asistan_mesaji_mi", "ID_PREFIX", "ARAC_OGELERI"),
|
||||
{"json": json, "re": __import__("re"), "time": time, "log": lambda m: None, "pencere": pencere})
|
||||
{"WATCH_OWNER": None, "WatchResponse": lambda response, accept: response, "json": json, "re": __import__("re"), "time": time, "log": lambda m: None, "pencere": pencere})
|
||||
|
||||
def events(self, raw):
|
||||
return [json.loads(line[6:]) for line in raw.decode().splitlines() if line.startswith("data: ")]
|
||||
@@ -256,7 +256,7 @@ class Zincir(unittest.TestCase):
|
||||
"claude_sonu_duzelt", "ek_model_mu", "yonlendirilen")
|
||||
+ [method("_responses"), method("_model_komutu"), method("_ozgun")], {
|
||||
"gecit_modelleri": lambda: [],
|
||||
"json": json, "re": __import__("re"), "os": __import__("os"), "copy": copy, "http": __import__("http.client"),
|
||||
"WATCH_OWNER": None, "WatchResponse": lambda response, accept: response, "json": json, "re": __import__("re"), "os": __import__("os"), "copy": copy, "http": __import__("http.client"),
|
||||
"time": types.SimpleNamespace(sleep=lambda s: None, time=time.time),
|
||||
"urllib": types.SimpleNamespace(request=types.SimpleNamespace(Request=urllib.request.Request, urlopen=Mock()),
|
||||
error=urllib.error),
|
||||
@@ -389,6 +389,22 @@ class Zincir(unittest.TestCase):
|
||||
self.assertEqual(sent["instructions"], req["instructions"])
|
||||
self.assertEqual(sent["input"][0], req["input"][0])
|
||||
|
||||
def test_nonvoice_json_still_reaches_original_jev_with_upstream_identity(self):
|
||||
self.env["ROUTES"]["aiturk-ide"] = {
|
||||
"url": "https://example.invalid/v1/responses", "key": "test-only", "flatten_tools": True}
|
||||
self.env["MODEL_MAP"]["ide/scope"] = ("aiturk-ide", "Other-Model", None)
|
||||
response = Mock(status=200, headers={"Content-Type": "application/json"})
|
||||
self.env["urllib"].request.urlopen.return_value = response
|
||||
watch = self.env["WatchResponse"] = Mock(side_effect=AssertionError("watch scope escaped"))
|
||||
fake = Sahte(); fake._denetimli_akis = Mock()
|
||||
with patch.object(self.env["jev_denetim"], "anahtar", return_value="test-only"):
|
||||
fake._responses(1, "/responses", json.dumps({"model":"ide/scope", "input":[user("task")]}).encode())
|
||||
fake._denetimli_akis.assert_called_once()
|
||||
self.assertIs(fake._denetimli_akis.call_args.args[0], response)
|
||||
self.assertEqual(fake._denetimli_akis.call_args.kwargs, {"hedef":"Other-Model"})
|
||||
response.read.assert_not_called()
|
||||
watch.assert_not_called(); fake._send_json.assert_not_called(); fake._stream.assert_not_called()
|
||||
|
||||
def test_combo_dropped_after_sending_is_not_resent_but_a_single_model_is(self):
|
||||
import http.client
|
||||
self.external(http.client.RemoteDisconnected("closed"))
|
||||
@@ -438,7 +454,7 @@ class Govde(unittest.TestCase):
|
||||
|
||||
class Liste(unittest.TestCase):
|
||||
def env(self, **extra):
|
||||
env = {"json": json, "copy": copy, "hashlib": hashlib, "time": time, "log": lambda m: None, "CFG": {},
|
||||
env = {"WATCH_OWNER": None, "WatchResponse": lambda response, accept: response, "json": json, "copy": copy, "hashlib": hashlib, "time": time, "log": lambda m: None, "CFG": {},
|
||||
"decompress": lambda raw, enc: raw, "EXTRA_MODELS": [], "IDE_PREFIX": "ide/", "SLIM_CLONES": False,
|
||||
"SLIM_FIELDS": [], "ide_catalog": ide_catalog, "LAST_MODELS": {}, "save_last_models": Mock(),
|
||||
"RESP_HOP": {"content-length", "content-encoding"}, "REQ_HOP": {"host"}, "CHATGPT": "https://example.invalid",
|
||||
|
||||
Reference in new issue
Block a user