build: complete upgrade to fastapi 0.141, mcp sdk v2, fastmcp 4 and httpx2

This commit is contained in:
lda
2026-09-06 12:17:15 +07:00 Verified
parent 5b901557bd
commit 6d5b6741fb
42 changed files with 946 additions and 737 deletions
+20 -18
View File
@@ -93,30 +93,32 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
assert "wf.workflow.run_deployment" in names
call_capability_schema = tools_by_name[
"wf.workflow.call_capability"
].outputSchema
].output_schema
assert call_capability_schema is not None
assert "source_id" in call_capability_schema["properties"]
assert "kind" in call_capability_schema["properties"]
assert "diagnostics" in call_capability_schema["properties"]
create_workspace_schema = tools_by_name[
"wf.workflow.create_draft_workspace"
].outputSchema
].output_schema
assert create_workspace_schema is not None
assert "workspace_id" in create_workspace_schema["properties"]
assert "revision" in create_workspace_schema["properties"]
list_sources_schema = tools_by_name["wf.admin.list_sources"].inputSchema
list_sources_schema = tools_by_name["wf.admin.list_sources"].input_schema
assert (
"inspect_source"
in list_sources_schema["properties"]["limit"]["description"]
)
inspect_source_schema = tools_by_name["wf.admin.inspect_source"].inputSchema
inspect_source_schema = tools_by_name[
"wf.admin.inspect_source"
].input_schema
assert (
"Exact source id"
in inspect_source_schema["properties"]["source_id"]["description"]
)
minimal_workspace_input = tools_by_name[
"wf.workflow.create_minimal_draft_workspace"
].inputSchema
].input_schema
minimal_request = _resolve_local_ref(
minimal_workspace_input["properties"]["request"],
minimal_workspace_input,
@@ -133,7 +135,7 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
)
from_capability_input = tools_by_name[
"wf.workflow.create_draft_workspace_from_capability"
].inputSchema
].input_schema
from_capability_request = _request_schema(from_capability_input)
assert "capability_name" in from_capability_request["properties"]
assert "input_schema" in from_capability_request["properties"]
@@ -142,24 +144,24 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
assert "output_map" in from_capability_request["properties"]
set_input_schema = tools_by_name[
"wf.workflow.set_step_input_map"
].inputSchema
].input_schema
set_input_request = _request_schema(set_input_schema)
assert "merge" in set_input_request["properties"]
set_bindings_schema = tools_by_name[
"wf.workflow.set_step_input_bindings"
].inputSchema
].input_schema
set_bindings_request = _request_schema(set_bindings_schema)
assert "bindings" in set_bindings_request["properties"]
assert "merge" not in set_bindings_request["properties"]
set_output_bindings_schema = tools_by_name[
"wf.workflow.set_step_output_bindings"
].inputSchema
].input_schema
set_output_bindings_request = _request_schema(set_output_bindings_schema)
assert "bindings" in set_output_bindings_request["properties"]
assert "merge" not in set_output_bindings_request["properties"]
canonical_workflow_output_schema = tools_by_name[
"wf.workflow.set_workflow_output_bindings"
].inputSchema
].input_schema
canonical_workflow_output_request = _request_schema(
canonical_workflow_output_schema
)
@@ -167,11 +169,11 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
assert "merge" not in canonical_workflow_output_request["properties"]
set_workflow_output_schema = tools_by_name[
"wf.workflow.set_workflow_output_map"
].inputSchema
].input_schema
set_workflow_output_request = _request_schema(set_workflow_output_schema)
assert "output_map" in set_workflow_output_request["properties"]
assert "merge" in set_workflow_output_request["properties"]
bind_schema = tools_by_name["wf.workflow.bind"].inputSchema
bind_schema = tools_by_name["wf.workflow.bind"].input_schema
bind_request = _request_schema(bind_schema)
assert set(bind_request["required"]) == {
"workspace_id",
@@ -185,7 +187,7 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
assert bind_request["properties"]["target_path"]["minLength"] == 1
add_step_schema = tools_by_name[
"wf.workflow.add_step_from_capability"
].inputSchema
].input_schema
add_step_request = _request_schema(add_step_schema)
assert "capability_name" in add_step_request["properties"]
assert "bind_outputs" in add_step_request["properties"]
@@ -195,12 +197,12 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
assert "timeout_seconds" in add_step_request["properties"]
update_step_schema = tools_by_name[
"wf.workflow.update_capability_step"
].inputSchema
].input_schema
update_step_request = _request_schema(update_step_schema)
assert "update" in update_step_request["properties"]
from_capability_output = tools_by_name[
"wf.workflow.create_draft_workspace_from_capability"
].outputSchema
].output_schema
assert from_capability_output is not None
assert "wrapper_hints" in from_capability_output["properties"]
assert "next_actions" in from_capability_output["properties"]
@@ -219,8 +221,8 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
validate_deployment = tools_by_name["wf.workflow.validate_deployment"]
run_deployment = tools_by_name["wf.workflow.run_deployment"]
validate_output = validate_deployment.outputSchema
run_output = run_deployment.outputSchema
validate_output = validate_deployment.output_schema
run_output = run_deployment.output_schema
assert validate_output is not None
assert "next_actions" in validate_output["properties"]
@@ -236,7 +238,7 @@ def test_server_exposes_upstream_admin_and_workflow_tools() -> None:
)
wrapper_workspace_input = tools_by_name[
"wf.workflow.create_wrapper_from_workspace"
].inputSchema
].input_schema
wrapper_request = wrapper_workspace_input["properties"]["request"]
assert "kind" not in wrapper_request["properties"]
assert "artifact_id" in wrapper_request["properties"]
+12 -12
View File
@@ -388,21 +388,21 @@ async def test_workflow_tools_have_human_metadata(tmp_path: Path) -> None:
assert list_artifacts.title == "List Workflow Artifacts"
assert "saved workflow artifacts" in (list_artifacts.description or "")
assert "query" in list_artifacts.inputSchema["properties"]
assert "kind" in list_artifacts.inputSchema["properties"]
assert "cursor" in list_artifacts.inputSchema["properties"]
assert "limit" in list_artifacts.inputSchema["properties"]
live_check_schema = validate_deployment.inputSchema["properties"]["live_check"]
assert "query" in list_artifacts.input_schema["properties"]
assert "kind" in list_artifacts.input_schema["properties"]
assert "cursor" in list_artifacts.input_schema["properties"]
assert "limit" in list_artifacts.input_schema["properties"]
live_check_schema = validate_deployment.input_schema["properties"]["live_check"]
assert "upstream" in live_check_schema.get("description", "")
assert run_deployment.title == "Run Workflow Deployment"
assert "deployment_id" in (run_deployment.description or "")
assert "trace_range" in run_deployment.inputSchema["properties"]
trace_range_schema = run_deployment.inputSchema["properties"]["trace_range"]
assert "trace_range" in run_deployment.input_schema["properties"]
trace_range_schema = run_deployment.input_schema["properties"]["trace_range"]
assert "Debug traces" in trace_range_schema.get("description", "")
assert "null" in [option.get("type") for option in trace_range_schema["anyOf"]]
assert inspect_run.title == "Inspect Workflow Run"
assert "trace" in (inspect_run.description or "").lower()
read_trace_schema = read_run_trace.inputSchema["properties"]["trace_range"]
read_trace_schema = read_run_trace.input_schema["properties"]["trace_range"]
assert "Debug traces" in read_trace_schema.get("description", "")
@@ -419,7 +419,7 @@ async def test_create_artifact_from_plan_exposes_plan_as_plain_object(
async with client:
tools = await client.list_tools()
by_name = {tool.name: tool for tool in tools}
schema = by_name["wf.workflow.create_artifact_from_plan"].inputSchema
schema = by_name["wf.workflow.create_artifact_from_plan"].input_schema
plan_schema = schema["properties"]["plan"]
assert plan_schema["type"] == "object"
@@ -440,11 +440,11 @@ async def test_draft_tools_expose_plain_object_and_patch_array_schemas(
tools = await client.list_tools()
by_name = {tool.name: tool for tool in tools}
validate_schema = by_name["wf.workflow.validate_draft"].inputSchema
validate_schema = by_name["wf.workflow.validate_draft"].input_schema
validate_draft_schema = validate_schema["properties"]["draft"]
create_schema = by_name["wf.workflow.create_artifact_from_draft"].inputSchema
create_schema = by_name["wf.workflow.create_artifact_from_draft"].input_schema
create_draft_schema = create_schema["properties"]["draft"]
patch_schema = by_name["wf.workflow.patch_draft"].inputSchema
patch_schema = by_name["wf.workflow.patch_draft"].input_schema
patch_draft_schema = patch_schema["properties"]["draft"]
patch_patch_schema = patch_schema["properties"]["patch"]