From bb9f1cbbb4ee28e10f564557b468abcdfbc7a341 Mon Sep 17 00:00:00 2001 From: codex Date: Sun, 26 Jul 2026 23:49:55 +0000 Subject: [PATCH] fix(orchestrator): keep host client dependency-free --- bot_bottle/orchestrator/api.py | 4 +--- bot_bottle/orchestrator/client.py | 2 +- bot_bottle/orchestrator/http_contract.py | 6 ++++++ bot_bottle/orchestrator/server.py | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 bot_bottle/orchestrator/http_contract.py diff --git a/bot_bottle/orchestrator/api.py b/bot_bottle/orchestrator/api.py index 909f04e0..a97eb108 100644 --- a/bot_bottle/orchestrator/api.py +++ b/bot_bottle/orchestrator/api.py @@ -13,11 +13,9 @@ from starlette.types import ASGIApp, Message, Receive, Scope, Send from ..orchestrator_auth import ROLE_CLI, ROLES from ..supervisor.types import TOOLS from ..trust_domain import CONTROL_PLANE +from .http_contract import MAX_BODY_BYTES, ORCHESTRATOR_AUTH_HEADER from .service import OrchestratorCore -ORCHESTRATOR_AUTH_HEADER = "x-bot-bottle-orchestrator-auth" -MAX_BODY_BYTES = 1 * 1024 * 1024 - _GATEWAY_ROUTES = frozenset({ ("POST", "/resolve"), ("POST", "/supervise/propose"), diff --git a/bot_bottle/orchestrator/client.py b/bot_bottle/orchestrator/client.py index ce032364..4748880b 100644 --- a/bot_bottle/orchestrator/client.py +++ b/bot_bottle/orchestrator/client.py @@ -21,7 +21,7 @@ from dataclasses import dataclass from ..log import debug from ..orchestrator_auth import ROLE_CLI from ..trust_domain import CONTROL_PLANE -from .server import ORCHESTRATOR_AUTH_HEADER +from .http_contract import ORCHESTRATOR_AUTH_HEADER DEFAULT_TIMEOUT_SECONDS = 5.0 diff --git a/bot_bottle/orchestrator/http_contract.py b/bot_bottle/orchestrator/http_contract.py new file mode 100644 index 00000000..4d2aeece --- /dev/null +++ b/bot_bottle/orchestrator/http_contract.py @@ -0,0 +1,6 @@ +"""Dependency-free constants shared by orchestrator HTTP clients and server.""" + +ORCHESTRATOR_AUTH_HEADER = "x-bot-bottle-orchestrator-auth" +MAX_BODY_BYTES = 1 * 1024 * 1024 + +__all__ = ["MAX_BODY_BYTES", "ORCHESTRATOR_AUTH_HEADER"] diff --git a/bot_bottle/orchestrator/server.py b/bot_bottle/orchestrator/server.py index 12ff277e..bbd5189b 100644 --- a/bot_bottle/orchestrator/server.py +++ b/bot_bottle/orchestrator/server.py @@ -10,7 +10,8 @@ import uvicorn from ..orchestrator_auth import ROLE_CLI, mint from ..trust_domain import CONTROL_PLANE -from .api import MAX_BODY_BYTES, ORCHESTRATOR_AUTH_HEADER, create_app +from .api import create_app +from .http_contract import MAX_BODY_BYTES, ORCHESTRATOR_AUTH_HEADER from .service import OrchestratorCore MAX_REQUESTS = 32