Merge pull request #125 from TimothyZhang7/chore/fix-git-actions
Release / Create Release (push) Waiting to run
Release / Create Release (push) Waiting to run
fix: fully tested ruff lint
This commit is contained in:
@@ -15,6 +15,7 @@ from typing import Annotated
|
||||
from mcp.server import FastMCP
|
||||
|
||||
from framework.graph import Goal, SuccessCriterion, Constraint, NodeSpec, EdgeSpec, EdgeCondition
|
||||
from framework.graph.plan import Plan
|
||||
|
||||
# Testing framework imports
|
||||
from framework.testing.test_case import Test, ApprovalStatus, TestType
|
||||
@@ -2644,7 +2645,7 @@ def get_pending_tests(
|
||||
# PLAN LOADING AND EXECUTION
|
||||
# =============================================================================
|
||||
|
||||
def load_plan_from_json(plan_json: str | dict) -> "Plan":
|
||||
def load_plan_from_json(plan_json: str | dict) -> Plan:
|
||||
"""
|
||||
Load a Plan object from exported JSON.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import json
|
||||
import os
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Callable
|
||||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
from framework.graph import Goal
|
||||
from framework.graph.edge import GraphSpec, EdgeSpec, EdgeCondition
|
||||
@@ -14,6 +14,9 @@ from framework.llm.provider import LLMProvider, Tool
|
||||
from framework.runner.tool_registry import ToolRegistry
|
||||
from framework.runtime.core import Runtime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from framework.runner.protocol import CapabilityResponse, AgentMessage
|
||||
|
||||
|
||||
@dataclass
|
||||
class AgentInfo:
|
||||
|
||||
@@ -81,15 +81,15 @@ class ToolRegistry:
|
||||
|
||||
param_type = "string" # Default
|
||||
if param.annotation != inspect.Parameter.empty:
|
||||
if param.annotation == int:
|
||||
if param.annotation is int:
|
||||
param_type = "integer"
|
||||
elif param.annotation == float:
|
||||
elif param.annotation is float:
|
||||
param_type = "number"
|
||||
elif param.annotation == bool:
|
||||
elif param.annotation is bool:
|
||||
param_type = "boolean"
|
||||
elif param.annotation == dict:
|
||||
elif param.annotation is dict:
|
||||
param_type = "object"
|
||||
elif param.annotation == list:
|
||||
elif param.annotation is list:
|
||||
param_type = "array"
|
||||
|
||||
properties[param_name] = {"type": param_type}
|
||||
|
||||
@@ -142,7 +142,7 @@ class SyncAgentWrapper:
|
||||
|
||||
# Check if we're already in an async context
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
asyncio.get_running_loop()
|
||||
# We're in an async context, can't use run_until_complete
|
||||
# This shouldn't happen in normal test execution
|
||||
raise RuntimeError("Cannot run sync wrapper from async context")
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ def main():
|
||||
print_step("Step 4: Testing MCP server...")
|
||||
try:
|
||||
# Try importing the MCP server module
|
||||
result = subprocess.run(
|
||||
subprocess.run(
|
||||
[sys.executable, "-c", "from framework.mcp import agent_builder_server"],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
|
||||
@@ -26,7 +26,7 @@ class TestOrchestratorLLMInitialization:
|
||||
def test_uses_custom_model_parameter(self):
|
||||
"""Test that custom model parameter is passed to LiteLLMProvider."""
|
||||
with patch.object(LiteLLMProvider, '__init__', return_value=None) as mock_init:
|
||||
orchestrator = AgentOrchestrator(model="gpt-4o")
|
||||
AgentOrchestrator(model="gpt-4o")
|
||||
|
||||
mock_init.assert_called_once_with(model="gpt-4o")
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class TestDecisionRecording:
|
||||
# Set node context
|
||||
runtime.set_node("search-node")
|
||||
|
||||
decision_id = runtime.decide(
|
||||
runtime.decide(
|
||||
intent="Search query",
|
||||
options=[{"id": "web", "description": "Web search"}],
|
||||
chosen="web",
|
||||
@@ -277,7 +277,7 @@ class TestConvenienceMethods:
|
||||
runtime = Runtime(tmp_path)
|
||||
runtime.start_run("test_goal", "Test")
|
||||
|
||||
decision_id = runtime.quick_decision(
|
||||
runtime.quick_decision(
|
||||
intent="Log message",
|
||||
action="Write to stdout",
|
||||
reasoning="Standard logging",
|
||||
|
||||
Reference in New Issue
Block a user