refactor(runtime): clear capability callback type debt

This commit is contained in:
jxxghp
2026-08-29 18:34:50 +08:00
parent 95606801af
commit 6d8a4667ee
2 changed files with 2 additions and 5 deletions

View File

@@ -171,7 +171,7 @@ class CapabilityRuntime:
raise CapabilityRuntimeClosedError("Capability Runtime 已关闭")
@staticmethod
def _sync_callback(adapter: Any, name: str, *args) -> Any:
def _sync_callback(adapter: Any, name: str, *args: Any) -> Any:
callback = getattr(adapter, name, None)
if not callable(callback):
raise CapabilityAdapterContractError(f"同步 adapter 缺少 {name}()")
@@ -186,7 +186,7 @@ class CapabilityRuntime:
return result
@staticmethod
async def _async_callback(adapter: Any, name: str, *args) -> Any:
async def _async_callback(adapter: Any, name: str, *args: Any) -> Any:
callback = getattr(adapter, name, None)
if not callable(callback):
raise CapabilityAdapterContractError(f"异步 adapter 缺少 {name}()")

View File

@@ -2961,9 +2961,6 @@
"type-arg": 3,
"unused-coroutine": 3
},
"app/runtime/capabilities/runtime.py": {
"no-untyped-def": 2
},
"app/runtime/compat/imports.py": {
"assignment": 1,
"attr-defined": 2,