diff --git a/_local/system.env.example b/_local/system.env.example index 4a162710..28c5fd51 100644 --- a/_local/system.env.example +++ b/_local/system.env.example @@ -317,10 +317,8 @@ OCLAW_WS_RATE_LIMIT_USER_PER_WINDOW=360 OCLAW_WS_SEND_QUEUE_MAX_MESSAGES=256 OCLAW_WS_SEND_QUEUE_MAX_BYTES= OCLAW_WS_EVENT_REPLAY_MAX=256 -# netx -> oclaw AP 分析接口共享 token(可选;设置后可用 Bearer 直接访问 /admin/api/ops-ai/analyze-sync) +# netx -> oclaw AP 分析接口共享 token(可选;设置后可用 Bearer 直接访问 /admin/api/ops-ai/analyze-sync,亦用于 /ws/netx-bridge 告警 WSS) OCLAW_OPS_AI_SHARED_TOKEN= -# netx -> oclaw 告警 WSS(/ws/netx-bridge)独立 token,与 OPS_AI 分开 -OCLAW_NETX_BRIDGE_TOKEN= # ----------------------------------------------------------------------------- # 十五、模型请求:工具 JSON、Replay 策略、Agent 消息回放 diff --git a/interfaces/ws/netx_bridge.py b/interfaces/ws/netx_bridge.py index 0d47639a..e18e1878 100644 --- a/interfaces/ws/netx_bridge.py +++ b/interfaces/ws/netx_bridge.py @@ -11,7 +11,7 @@ from svc.persistence.assistant_store import get_assistant_store def _bridge_token_expected() -> str: - return str(os.getenv("OCLAW_NETX_BRIDGE_TOKEN") or "").strip() + return str(os.getenv("OCLAW_OPS_AI_SHARED_TOKEN") or "").strip() def _verify_bridge_token(token: str) -> bool: diff --git a/tests/test_netx_bridge_whatsapp_outbound.py b/tests/test_netx_bridge_whatsapp_outbound.py index 973d1d49..14617277 100644 --- a/tests/test_netx_bridge_whatsapp_outbound.py +++ b/tests/test_netx_bridge_whatsapp_outbound.py @@ -13,8 +13,8 @@ from svc.persistence.assistant_store import reset_assistant_store_singleton class NetxBridgeTests(unittest.TestCase): def setUp(self) -> None: - os.environ["OCLAW_NETX_BRIDGE_TOKEN"] = "test-bridge-token" - os.environ.pop("OCLAW_OPS_AI_SHARED_TOKEN", None) + os.environ["OCLAW_OPS_AI_SHARED_TOKEN"] = "test-bridge-token" + os.environ.pop("OCLAW_NETX_BRIDGE_TOKEN", None) os.environ["AIA_WHATSAPP_ACCOUNT_ID"] = "wa-default" reset_assistant_store_singleton() self.client = TestClient(create_app())