Skip to content
Merged
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
5 changes: 2 additions & 3 deletions src/fast_agent/acp/slash_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ def parse_command(self, prompt_text: str) -> tuple[str, str]:
text = text[1:]

# Split on first whitespace
parts = text.split(None, 1)
command_name = parts[0] if parts else ""
arguments = parts[1] if len(parts) > 1 else ""
command_name, _, arguments = text.partition(" ")
arguments = arguments.lstrip()

return command_name, arguments

Expand Down
6 changes: 2 additions & 4 deletions src/fast_agent/cli/commands/url_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def generate_server_name(url: str) -> str:
parsed_url = urlparse(url)

# Extract hostname and port
hostname = parsed_url.netloc.split(":")[0]
hostname, _, port_str = parsed_url.netloc.partition(":")

# Clean the hostname for use in a server name
# Replace non-alphanumeric characters with underscores
Expand All @@ -89,9 +89,7 @@ def generate_server_name(url: str) -> str:
path = re.sub(r"[^a-zA-Z0-9]", "_", path)

# Include port if specified
port = ""
if ":" in parsed_url.netloc:
port = f"_{parsed_url.netloc.split(':')[1]}"
port = f"_{port_str}" if port_str else ""

if path:
return f"{clean_hostname}{port}_{path[:20]}" # Limit path length
Expand Down
2 changes: 1 addition & 1 deletion src/fast_agent/llm/internal/passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def _apply_prompt_provider_specific(
stop_reason: LlmStopReason = LlmStopReason.END_TURN
if self.is_tool_call(last_message):
tool_name, arguments = self._parse_tool_command(last_message.first_text())
tool_calls["correlationId" + str(self._correlation_id)] = CallToolRequest(
tool_calls[f"correlationId{self._correlation_id}"] = CallToolRequest(
method="tools/call",
params=CallToolRequestParams(name=tool_name, arguments=arguments),
)
Expand Down
2 changes: 1 addition & 1 deletion src/fast_agent/mcp/elicitation_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async def forms_elicitation_handler(
properties = params.requestedSchema.get("properties", {})
if len(properties) == 1:
# Single field schema - try to parse based on type
field_name = list(properties.keys())[0]
field_name = next(iter(properties))
field_def = properties[field_name]
field_type = field_def.get("type")

Expand Down
2 changes: 1 addition & 1 deletion src/fast_agent/mcp/prompts/prompt_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def has_text_at_first_position(message: Union[PromptMessage, "PromptMessageExten
return isinstance(message.content, TextContent)

# For multipart messages, check if there's at least one item and the first is TextContent
return len(message.content) > 0 and isinstance(message.content[0], TextContent)
return bool(message.content) and isinstance(message.content[0], TextContent)

@staticmethod
def get_text_at_first_position(
Expand Down
2 changes: 1 addition & 1 deletion src/fast_agent/ui/interactive_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ async def _select_prompt(

rich_print() # Space between prompts

prompt_names = [str(i + 1) for i in range(len(all_prompts))]
prompt_names = [str(i) for i, _ in enumerate(all_prompts, 1)]

# Get user selection
selection = await get_selection_input(
Expand Down
2 changes: 1 addition & 1 deletion src/fast_agent/ui/tool_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def show_tool_result(
if result.isError:
status = "ERROR"
else:
if len(content) == 0:
if not content:
status = "No Content"
elif len(content) == 1 and is_text_content(content[0]):
text_content = get_text(content[0])
Expand Down
45 changes: 0 additions & 45 deletions src/mcp_agent/agents/agent.py

This file was deleted.

27 changes: 0 additions & 27 deletions src/mcp_agent/core/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/mcp_agent/core/agent_app.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/mcp_agent/core/direct_decorators.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/mcp_agent/core/fastagent.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/mcp_agent/core/prompt.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/mcp_agent/mcp/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/mcp_agent/mcp/helpers/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions src/mcp_agent/mcp/helpers/content_helpers.py

This file was deleted.

17 changes: 0 additions & 17 deletions src/mcp_agent/mcp/prompt_message_multipart.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/e2e/llm/test_llm_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def llm_agent_setup(model_name):
test_config = AgentConfig("test")

# Pass the config file path from the test directory
config_path = os.path.join(os.path.dirname(__file__), "fastagent.config.yaml")
config_path = Path(__file__).parent / "fastagent.config.yaml"

# Initialize Core and agent
core = Core(settings=config_path)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List

import pytest
Expand Down Expand Up @@ -177,11 +178,10 @@ async def agent_function():
async def test_prompt_server_sse_can_set_ports(fast_agent):
# Start the SSE server in a subprocess
import asyncio
import os
import subprocess

# Get the path to the test agent
test_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = Path(__file__).resolve().parent

# Port must match what's in the fastagent.config.yaml
port = 8723
Expand Down Expand Up @@ -225,11 +225,10 @@ async def agent_function():
async def test_prompt_server_http_can_set_ports(fast_agent):
# Start the SSE server in a subprocess
import asyncio
import os
import subprocess

# Get the path to the test agent
test_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = Path(__file__).resolve().parent

# Port must match what's in the fastagent.config.yaml
port = 8724
Expand Down
Loading