Skip to content

Conversation

@cristipufu
Copy link
Member

@cristipufu cristipufu commented Jul 21, 2025

Summary

This PR fixes the server identification mechanism to use the FpsContext slug when available, falling back to the server name when not present. This ensures that the correct server identifier is used for API calls and tracing operations.

  • Uses FpsContext slug from configuration files as the primary server identifier
  • Adds a new slug property to UiPathMcpRuntime that returns the FpsContext slug or falls back to server name
  • Updates SessionServer constructor to accept and use the server slug parameter

@cristipufu cristipufu self-assigned this Jul 21, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the server identification mechanism to use the FpsContext slug when available, falling back to the server name when not present. This ensures that the correct server identifier is used for API calls and tracing operations.

  • Uses FpsContext slug from configuration files as the primary server identifier
  • Adds a new slug property to UiPathMcpRuntime that returns the FpsContext slug or falls back to server name
  • Updates SessionServer constructor to accept and use the server slug parameter

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/uipath_mcp/_cli/_runtime/_context.py Adds from_config method to parse FpsContext from uipath.json and extract server_id/server_slug
src/uipath_mcp/_cli/_runtime/_runtime.py Adds slug property and updates all API calls and tracing to use slug instead of server name
src/uipath_mcp/_cli/_runtime/_session.py Updates constructor to accept server_slug parameter and uses it for all API calls
pyproject.toml Bumps version from 0.0.97 to 0.0.98

server_slug: Optional[str] = None

@classmethod
def from_config(cls, config_path=None):
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The config_path parameter should have a type annotation. Consider adding config_path: Optional[str] = None for better API clarity.

Suggested change
def from_config(cls, config_path=None):
def from_config(cls, config_path: Optional[str] = None):

Copilot uses AI. Check for mistakes.
mcp_instance = cls(**instance.model_dump())

# Add AgentHub-specific configuration handling
import json
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Imports should be placed at the top of the file rather than inside methods. Move the json and os imports to the module level.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +29
import json
import os

Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Imports should be placed at the top of the file rather than inside methods. Move the json and os imports to the module level.

Suggested change
import json
import os

Copilot uses AI. Check for mistakes.
@cristipufu cristipufu added the build:dev Create a dev build from the pr label Jul 21, 2025
@cristipufu cristipufu merged commit 3ae9762 into main Jul 21, 2025
7 checks passed
@cristipufu cristipufu deleted the fix/decouple_entrypoint branch July 21, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants