fix(orchestrator): bound streamed request bodies
test / integration-docker (pull_request) Has been cancelled
tracker-policy-pr / check-pr (pull_request) Failing after 7s
test / image-input-builds (pull_request) Failing after 13m54s
test / unit (pull_request) Failing after 13m59s
test / coverage (pull_request) Has been skipped

This commit is contained in:
2026-07-27 02:24:06 +00:00
parent bb9f1cbbb4
commit a1acdd9665
6 changed files with 194 additions and 57 deletions
+26
View File
@@ -3,6 +3,8 @@
from __future__ import annotations
import json
import subprocess
import sys
import unittest
import urllib.error
from unittest.mock import MagicMock, patch
@@ -20,6 +22,30 @@ from bot_bottle.orchestrator.client import (
_URLOPEN = "bot_bottle.orchestrator.client.urllib.request.urlopen"
class TestImportBoundary(unittest.TestCase):
def test_host_client_does_not_import_server_dependencies(self) -> None:
script = """
import importlib.abc
import sys
class BlockServerDependencies(importlib.abc.MetaPathFinder):
def find_spec(self, fullname, path=None, target=None):
if fullname.split(".", 1)[0] in {"fastapi", "uvicorn"}:
raise ImportError(f"host import reached {fullname}")
return None
sys.meta_path.insert(0, BlockServerDependencies())
import bot_bottle.orchestrator.client
"""
result = subprocess.run(
[sys.executable, "-c", script],
capture_output=True,
text=True,
check=False,
)
self.assertEqual(0, result.returncode, result.stderr)
class TestHostAuthToken(unittest.TestCase):
def test_mints_a_cli_token_from_the_host_key(self) -> None:
# The CLI mints its `cli` token from the control-plane trust domain's