Renaming from async_tool to tool.

This commit is contained in:
filipi87
2026-04-03 08:20:14 -03:00
parent 7af72eee3e
commit eace782752
2 changed files with 6 additions and 6 deletions

View File

@@ -1061,7 +1061,7 @@ class LLMAssistantAggregator(LLMContextAggregator):
self._context.add_message( self._context.add_message(
{ {
"role": "tool", "role": "tool",
"content": json.dumps({"type": "async_tool", "status": "started"}), "content": json.dumps({"type": "tool", "status": "started"}),
"tool_call_id": frame.tool_call_id, "tool_call_id": frame.tool_call_id,
} }
) )
@@ -1104,7 +1104,7 @@ class LLMAssistantAggregator(LLMContextAggregator):
"role": "developer", "role": "developer",
"content": json.dumps( "content": json.dumps(
{ {
"type": "async_tool", "type": "tool",
"tool_call_id": frame.tool_call_id, "tool_call_id": frame.tool_call_id,
"status": "finished", "status": "finished",
"result": result, "result": result,

View File

@@ -388,7 +388,7 @@ class LLMContextSummarizationUtil:
A tool message is considered pending (unresolved) when its content is A tool message is considered pending (unresolved) when its content is
the synchronous ``"IN_PROGRESS"`` sentinel or the async the synchronous ``"IN_PROGRESS"`` sentinel or the async
``{"type": "async_tool", "status": "started"}`` marker — both indicate ``{"type": "tool", "status": "started"}`` marker — both indicate
that the actual result has not yet been written back to the context. that the actual result has not yet been written back to the context.
Args: Args:
@@ -403,7 +403,7 @@ class LLMContextSummarizationUtil:
parsed = json.loads(content) parsed = json.loads(content)
if ( if (
isinstance(parsed, dict) isinstance(parsed, dict)
and parsed.get("type") == "async_tool" and parsed.get("type") == "tool"
and parsed.get("status") == "started" and parsed.get("status") == "started"
): ):
return True return True
@@ -474,14 +474,14 @@ class LLMContextSummarizationUtil:
pending_tool_calls.pop(tool_call_id) pending_tool_calls.pop(tool_call_id)
# Check for async tool completion — a developer message with # Check for async tool completion — a developer message with
# {"type": "async_tool", "status": "finished"} signals that the # {"type": "tool", "status": "finished"} signals that the
# async result has arrived and the call is now resolved. # async result has arrived and the call is now resolved.
if role == "developer": if role == "developer":
try: try:
parsed = json.loads(msg.get("content", "")) parsed = json.loads(msg.get("content", ""))
if ( if (
isinstance(parsed, dict) isinstance(parsed, dict)
and parsed.get("type") == "async_tool" and parsed.get("type") == "tool"
and parsed.get("status") == "finished" and parsed.get("status") == "finished"
): ):
tool_call_id = parsed.get("tool_call_id") tool_call_id = parsed.get("tool_call_id")