Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
@@ -0,0 +1,36 @@
"""Regression tests for own-policy open startup gate in gateway/run.py."""
import pytest
from gateway.config import GatewayConfig, Platform, PlatformConfig
from gateway.run import GatewayRunner
@pytest.mark.asyncio
async def test_unrelated_allow_all_does_not_bypass_yuanbao_open_gate(
monkeypatch, tmp_path,
):
"""TELEGRAM_ALLOW_ALL_USERS must not satisfy Yuanbao's open-policy opt-in."""
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
monkeypatch.delenv("GATEWAY_ALLOW_ALL_USERS", raising=False)
monkeypatch.delenv("YUANBAO_ALLOW_ALL_USERS", raising=False)
monkeypatch.setenv("TELEGRAM_ALLOW_ALL_USERS", "true")
config = GatewayConfig(
platforms={
Platform.YUANBAO: PlatformConfig(
enabled=True,
extra={"dm_policy": "open"},
),
},
sessions_dir=tmp_path / "sessions",
)
runner = GatewayRunner(config)
ok = await runner.start()
assert ok is True
assert runner.should_exit_cleanly is True
assert "yuanbao" in (runner.exit_reason or "").lower()