mirror of
https://github.com/Colton-z/AstraBox.git
synced 2026-09-28 06:02:56 +08:00
The open-source, self-hosted alternative to Claude Managed Agents: run Claude Code, Codex, Hermes, DeepSeek Harness and Pi as managed Agents on your own infrastructure, with conversations that start and resume in seconds.
29 lines
988 B
Python
29 lines
988 B
Python
"""OpenSandbox integration guards for the supported SDK contract."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def test_importing_sandbox_client_does_not_monkeypatch_opensandbox() -> None:
|
|
"""Production imports must not mutate process-global third-party SDK behavior."""
|
|
result = subprocess.run(
|
|
[
|
|
sys.executable,
|
|
"-c",
|
|
(
|
|
"from opensandbox.adapters.converter.sandbox_model_converter "
|
|
"import SandboxModelConverter;"
|
|
"before = SandboxModelConverter.__dict__['to_paged_sandbox_infos'];"
|
|
"import astrabox.core.service.orchestrator.runtime.sandbox_client;"
|
|
"after = SandboxModelConverter.__dict__['to_paged_sandbox_infos'];"
|
|
"assert after is before"
|
|
),
|
|
],
|
|
check=False,
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
assert result.returncode == 0, result.stderr or result.stdout
|