sudden code review
This commit is contained in:
@@ -130,9 +130,7 @@ class CombinedCatalog:
|
||||
"description": entry.description,
|
||||
"outcomes": list(entry.outcomes),
|
||||
"input_schema": entry.input_schema,
|
||||
"output_schema": workflow_output_schema_from_mcp_tool_schema(
|
||||
entry.output_schema
|
||||
),
|
||||
"output_schema": entry.output_schema,
|
||||
}
|
||||
for entry in self.entries()
|
||||
],
|
||||
|
||||
@@ -49,9 +49,8 @@ from ...models import (
|
||||
ConnectionConfig,
|
||||
RawWorkflowPlan,
|
||||
)
|
||||
from ...runtime import ToolExecutor
|
||||
from ...sdk.converters import workflow_output_schema_from_mcp_tool_schema
|
||||
from ...sdk import BackendAdapter
|
||||
from ...runtime import ToolExecutor
|
||||
from ...shared.errors import error_payload
|
||||
from ...shared.names import RESERVED_CONNECTION_IDS
|
||||
from ...storage import Store
|
||||
@@ -876,7 +875,7 @@ class WfMcpService:
|
||||
"""
|
||||
model_prefix = entry.qualified_name.replace(".", "_").replace("-", "_")
|
||||
input_model = _model_from_schema(f"{model_prefix}_Input", entry.input_schema)
|
||||
output_schema = workflow_output_schema_from_mcp_tool_schema(entry.output_schema)
|
||||
output_schema = entry.output_schema
|
||||
output_model = _model_from_schema(f"{model_prefix}_Output", output_schema)
|
||||
|
||||
async def invoke_tool(payload: BaseModel) -> NodeReturn[BaseModel]:
|
||||
|
||||
@@ -18,6 +18,9 @@ from ..shared.names import ProxyNamespace
|
||||
|
||||
ProxyT = TypeVar("ProxyT")
|
||||
ProxyMountFactory = Callable[[ConnectionConfig, Path], "ProxyMount[ProxyT]"]
|
||||
# Bound proxy listing so one unresponsive upstream source cannot stall the
|
||||
# whole broker. Eight seconds is intentionally longer than normal local stdio
|
||||
# startup/handshake time, but short enough to make a broken source visible.
|
||||
_PROXY_LIST_TIMEOUT_SECONDS = 8.0
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -182,9 +185,10 @@ async def _bounded_proxy_list(
|
||||
return await asyncio.wait_for(listing, timeout=timeout_seconds)
|
||||
except (TimeoutError, OSError, ConnectionError) as exc:
|
||||
logger.warning(
|
||||
"Skipping %s for connection %s after listing failure: %s",
|
||||
"Skipping %s for connection %s after %s listing failure: %s",
|
||||
operation,
|
||||
connection_id,
|
||||
type(exc).__name__,
|
||||
exc,
|
||||
)
|
||||
return []
|
||||
|
||||
@@ -13,7 +13,6 @@ from wf_mcp.broker.events import McpEvent, make_event
|
||||
from ..capabilities import DiscoveredTool
|
||||
from ..models import AuthRecord, ConnectionConfig
|
||||
from ..runtime import ToolExecutor
|
||||
from ..sdk.converters import workflow_output_schema_from_mcp_tool_schema
|
||||
|
||||
|
||||
_JSON_TYPE_MAP: dict[str, object] = {
|
||||
@@ -129,10 +128,9 @@ def wrap_discovered_tool(
|
||||
f"{connection.id}_{tool.name}_Input",
|
||||
tool.input_schema,
|
||||
)
|
||||
output_schema = workflow_output_schema_from_mcp_tool_schema(tool.output_schema)
|
||||
output_model = _model_from_schema(
|
||||
f"{connection.id}_{tool.name}_Output",
|
||||
output_schema,
|
||||
tool.output_schema,
|
||||
)
|
||||
|
||||
async def invoke_tool(
|
||||
@@ -182,5 +180,5 @@ def wrap_discovered_tool(
|
||||
description=tool.description,
|
||||
is_async=True,
|
||||
input_schema_contract=tool.input_schema,
|
||||
output_schema_contract=output_schema,
|
||||
output_schema_contract=tool.output_schema,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user