chore(types): annotate four containers mypy could not infer
Each element type is taken from how the container is used rather than guessed: kept_items is returned from trim_to_fit, whose signature is already list[Any]; traces collects the dicts built at the append site; expert_results and tool_outputs are keyed by tool_name (str) and hold ToolReturnPart.content. tracing_router.py needed `from typing import Any` added — it had no import for it, so annotating without that would have traded a var-annotated error for a name-defined one. Function-body variable annotations are not evaluated at runtime, so this would not have raised; mypy was the only thing that would have caught it. 90 errors -> 86. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -736,8 +736,8 @@ class TatlockAgent(AgentInterface):
|
||||
|
||||
# Extract tool calls and results from the agent's messages
|
||||
tools_called = []
|
||||
expert_results = {}
|
||||
tool_outputs = {}
|
||||
expert_results: dict[str, Any] = {}
|
||||
tool_outputs: dict[str, Any] = {}
|
||||
|
||||
# Parse through new messages to find tool calls and returns
|
||||
for msg in result.new_messages():
|
||||
|
||||
Reference in New Issue
Block a user