fix: clean basedpyright test errors

This commit is contained in:
lda
2026-06-09 18:57:48 +07:00 Verified
parent 108d7ab7fc
commit 0e99bb660f
8 changed files with 37 additions and 21 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ def migrate_broker_config_file(path: str | Path) -> WorkflowConfigFile:
def build_service_from_config(config: BrokerConfig) -> WfMcpService:
"""Create a broker service with SDK adapters for configured connections."""
runtime_factory = PersistentSessionFactory()
store_roots = config.store_roots or BrokerStoreRoots.from_default(config.store_root)
store_roots = config.store_roots
workflow_stores = file_workflow_stores(store_roots.workflow_root)
# Keep FileStore as the compatibility facade on WfMcpService.store while
# focused services receive role-specific stores.
+12 -6
View File
@@ -43,15 +43,21 @@ class ConnectionConfig:
source_config_ownership: SourceConfigOwnership = "locked"
@dataclass(slots=True)
@dataclass(slots=True, init=False)
class BrokerConfig:
store_root: Path
connections: list[ConnectionConfig] = field(default_factory=list)
store_roots: BrokerStoreRoots | None = None
connections: list[ConnectionConfig]
store_roots: BrokerStoreRoots
def __post_init__(self) -> None:
if self.store_roots is None:
self.store_roots = BrokerStoreRoots.from_default(self.store_root)
def __init__(
self,
store_root: Path,
connections: list[ConnectionConfig] | None = None,
store_roots: BrokerStoreRoots | None = None,
) -> None:
self.store_root = store_root
self.connections = [] if connections is None else connections
self.store_roots = store_roots or BrokerStoreRoots.from_default(store_root)
__all__ = [
-1
View File
@@ -107,7 +107,6 @@ def workflow_server_from_service(
def build_workflow_server_from_config(config: BrokerConfig) -> WorkflowServer:
"""Build a neutral WorkflowServer backed by MCP broker runtime services."""
service = build_service_from_config(config)
assert config.store_roots is not None
return workflow_server_from_service(
service,
config=config,