Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ build/
.eggs/
.pytest_cache/
_version.py
.coverage
.coverage.*
htmlcov/

# Virtual environments
.venv/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
get_tooling_gateway_for_digital_worker,
get_mcp_base_url,
build_mcp_server_url,
get_tools_mode,
get_mcp_platform_authentication_scope,
get_ppapi_token_scope,
)

__all__ = [
"Constants",
"get_tooling_gateway_for_digital_worker",
"get_mcp_base_url",
"build_mcp_server_url",
"get_tools_mode",
"get_mcp_platform_authentication_scope",
"get_ppapi_token_scope",
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
"""

import os
from enum import Enum


class ToolsMode(Enum):
"""Enumeration for different tools modes."""

MOCK_MCP_SERVER = "MockMCPServer"
MCP_PLATFORM = "MCPPlatform"


# Constants for base URLs
Expand Down Expand Up @@ -43,16 +35,6 @@ def get_mcp_base_url() -> str:
Returns:
str: The base URL for MCP servers.
"""
environment = _get_current_environment().lower()

if environment == "development":
tools_mode = get_tools_mode()
if tools_mode == ToolsMode.MOCK_MCP_SERVER:
return os.getenv("MOCK_MCP_SERVER_URL", "http://localhost:5309/mcp-mock/agents/servers")

if not get_use_environment_id():
return f"{_get_mcp_platform_base_url()}/agents/servers"

return f"{_get_mcp_platform_base_url()}/mcp/environments"


Expand All @@ -68,14 +50,7 @@ def build_mcp_server_url(environment_id: str, server_name: str) -> str:
str: The full MCP server URL.
"""
base_url = get_mcp_base_url()
environment = _get_current_environment().lower()

if not get_use_environment_id() or (
environment == "development" and base_url.endswith("servers")
):
return f"{base_url}/{server_name}"
else:
return f"{base_url}/{environment_id}/servers/{server_name}"
return f"{base_url}/{environment_id}/servers/{server_name}"


def _get_current_environment() -> str:
Expand All @@ -85,7 +60,7 @@ def _get_current_environment() -> str:
Returns:
str: The current environment name.
"""
return os.getenv("ASPNETCORE_ENVIRONMENT") or os.getenv("DOTNET_ENVIRONMENT") or "Development"
return os.getenv("ENVIRONMENT") or "Development"
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed environment variables ASPNETCORE_ENVIRONMENT and DOTNET_ENVIRONMENT are referenced by "Kairo" in existing code files. According to custom guideline 1000000, the keyword "Kairo" should be removed or replaced with appropriate terminology. Multiple files in the codebase contain "Kairo" references including comments like "Kairo Python SDK", "Kairo tracer", "KairoInstrumentorOpenAIAgents" class names, and module descriptions mentioning "Kairo SDK". These should be updated to use Microsoft-appropriate terminology.

Copilot generated this review using guidance from repository custom instructions.


def _get_mcp_platform_base_url() -> str:
Expand All @@ -101,33 +76,7 @@ def _get_mcp_platform_base_url() -> str:
return MCP_PLATFORM_PROD_BASE_URL


def get_use_environment_id() -> bool:
"""
Determines whether to use environment ID in MCP server URL construction.

Returns:
bool: True if environment ID should be used, False otherwise.
"""
use_environment = os.getenv("USE_ENVIRONMENT_ID", "true").lower()
return use_environment == "true"


def get_tools_mode() -> ToolsMode:
"""
Gets the tools mode for the application.

Returns:
ToolsMode: The tools mode enum value.
"""
tools_mode = os.getenv("TOOLS_MODE", "MCPPlatform").lower()

if tools_mode == "mockmcpserver":
return ToolsMode.MOCK_MCP_SERVER
else:
return ToolsMode.MCP_PLATFORM


def get_mcp_platform_authentication_scope():
def get_ppapi_token_scope():
"""
Gets the MCP platform authentication scope based on the current environment.
Comment on lines +79 to 81
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name get_ppapi_token_scope doesn't match the docstring which refers to 'MCP platform authentication scope'. The docstring should be updated to reflect that this returns the Power Platform API token scope.

Copilot uses AI. Check for mistakes.

Expand Down
5 changes: 5 additions & 0 deletions tests/microsoft-agents-a365-notification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.

Copilot generated this review using guidance from repository custom instructions.

"""
Unit tests for Microsoft Agents A365 Notifications module.
"""
5 changes: 5 additions & 0 deletions tests/microsoft-agents-a365-notification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.

Copilot generated this review using guidance from repository custom instructions.

"""
Unit tests for Microsoft Agents A365 Notifications models.
"""
Loading
Loading