Skip to content

Commit 2de7f7f

Browse files
committed
Resolving PR review comments
1 parent 59b71f6 commit 2de7f7f

5 files changed

Lines changed: 193 additions & 386 deletions

File tree

libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/utils/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
get_tooling_gateway_for_digital_worker,
1010
get_mcp_base_url,
1111
build_mcp_server_url,
12-
get_tools_mode,
1312
get_ppapi_token_scope,
1413
)
1514

@@ -18,6 +17,5 @@
1817
"get_tooling_gateway_for_digital_worker",
1918
"get_mcp_base_url",
2019
"build_mcp_server_url",
21-
"get_tools_mode",
2220
"get_ppapi_token_scope",
2321
]

libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/utils/utility.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
"""
66

77
import os
8-
from enum import Enum
9-
10-
11-
class ToolsMode(Enum):
12-
"""Enumeration for different tools modes."""
13-
14-
MOCK_MCP_SERVER = "MockMCPServer"
15-
MCP_PLATFORM = "MCPPlatform"
168

179

1810
# Constants for base URLs
@@ -43,13 +35,6 @@ def get_mcp_base_url() -> str:
4335
Returns:
4436
str: The base URL for MCP servers.
4537
"""
46-
environment = _get_current_environment().lower()
47-
48-
if environment == "development":
49-
tools_mode = get_tools_mode()
50-
if tools_mode == ToolsMode.MOCK_MCP_SERVER:
51-
return os.getenv("MOCK_MCP_SERVER_URL", "http://localhost:5309/mcp-mock/agents/servers")
52-
5338
return f"{_get_mcp_platform_base_url()}/mcp/environments"
5439

5540

@@ -65,12 +50,7 @@ def build_mcp_server_url(environment_id: str, server_name: str) -> str:
6550
str: The full MCP server URL.
6651
"""
6752
base_url = get_mcp_base_url()
68-
environment = _get_current_environment().lower()
69-
70-
if environment == "development" and base_url.endswith("servers"):
71-
return f"{base_url}/{server_name}"
72-
else:
73-
return f"{base_url}/{environment_id}/servers/{server_name}"
53+
return f"{base_url}/{environment_id}/servers/{server_name}"
7454

7555

7656
def _get_current_environment() -> str:
@@ -96,21 +76,6 @@ def _get_mcp_platform_base_url() -> str:
9676
return MCP_PLATFORM_PROD_BASE_URL
9777

9878

99-
def get_tools_mode() -> ToolsMode:
100-
"""
101-
Gets the tools mode for the application.
102-
103-
Returns:
104-
ToolsMode: The tools mode enum value.
105-
"""
106-
tools_mode = os.getenv("TOOLS_MODE", "MCPPlatform").lower()
107-
108-
if tools_mode == "mockmcpserver":
109-
return ToolsMode.MOCK_MCP_SERVER
110-
else:
111-
return ToolsMode.MCP_PLATFORM
112-
113-
11479
def get_ppapi_token_scope():
11580
"""
11681
Gets the PPAI token scope based on the current environment.

tests/microsoft-agents-a365-notification/models/test_agent_notification.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,6 @@ def test_init_with_enum_subchannels(self):
9898
assert "email" in agent_notification._known_subchannels
9999
assert "word" in agent_notification._known_subchannels
100100

101-
def test_normalize_subchannel_with_string(self):
102-
"""Test _normalize_subchannel with string input"""
103-
# Arrange & Act & Assert
104-
assert AgentNotification._normalize_subchannel("EMAIL") == "email"
105-
assert AgentNotification._normalize_subchannel(" Word ") == "word"
106-
assert AgentNotification._normalize_subchannel("custom") == "custom"
107-
108-
def test_normalize_subchannel_with_enum(self):
109-
"""Test _normalize_subchannel with enum input"""
110-
# Arrange & Act & Assert
111-
assert AgentNotification._normalize_subchannel(AgentSubChannel.EMAIL) == "email"
112-
assert AgentNotification._normalize_subchannel(AgentSubChannel.WORD) == "word"
113-
114-
def test_normalize_subchannel_with_none(self):
115-
"""Test _normalize_subchannel with None input"""
116-
# Arrange & Act & Assert
117-
assert AgentNotification._normalize_subchannel(None) == ""
118-
119101
def test_on_agent_notification_decorator_creation(self):
120102
"""Test that on_agent_notification creates proper decorator"""
121103
# Arrange

0 commit comments

Comments
 (0)