refactor: enforce BasedPyright strict type checking (#5158)

This commit is contained in:
chengyongru
2026-07-29 21:37:11 +08:00
committed by GitHub
parent e703481755
commit 757ad9c764
166 changed files with 4728 additions and 2621 deletions
+7 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
from collections.abc import Awaitable, Callable
from pathlib import Path
from typing import Any
from typing import Any, cast
from nanobot.agent.hook import (
AgentHook,
@@ -56,17 +56,21 @@ class FileEditActivityHook(AgentHook):
) -> None:
if self._on_progress is None or not isinstance(params, dict):
return
typed_params = cast(dict[str, Any], params)
trackers = prepare_file_edit_trackers(
call_id=tool_call.id,
tool_name=tool_call.name,
tool=tool,
workspace=self._workspace,
params=params,
params=typed_params,
)
if not trackers:
return
self._trackers_by_call[self._tool_call_key(tool_call)] = trackers
await self._emit([build_file_edit_start_event(tracker, params) for tracker in trackers])
await self._emit([
build_file_edit_start_event(tracker, typed_params)
for tracker in trackers
])
async def after_execute_tool(
self,