Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/toad/acp/status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Specification-spelled reasons and statuses own toolkit independent facts."""
from agent_comms.declared_family import DeclaredFamily
from agent_comms.mro_dispatch import MroDispatch, handles
from agent_comms.native_tools import NativeTool
from agent_comms.transcript_events import ToolTranscript, ToolStartTranscript, ToolEndTranscript
from dataclasses import dataclass
from acp.schema import ToolCall
Expand Down Expand Up @@ -50,17 +49,18 @@ def from_transcript(cls, events: tuple[ToolTranscript, ...]):
borrow the final ACP state, including an end without its earlier start.
"""
first = events[0]
call = ToolCall(tool_call_id=first.tool_call_id, title='', status='completed')
call = ToolCall(tool_call_id=first.tool_call_id, title=first.title,
kind=first.kind, status='completed')
consumer = cls(call)
for event in events:
consumer.dispatch_sync(event)
start = NativeTool.start(first.tool_call_id, first.tool_name, call.raw_input or {})
call.title = start.title
call.kind = start.kind
return cls.from_acp(call)

@handles(ToolStartTranscript)
def recorded_start(self, event: ToolStartTranscript):
self.call.status = 'in_progress'
self.call.title = event.title
self.call.kind = event.kind
self.call.raw_input = event.raw_input

@handles(ToolEndTranscript)
Expand Down
2 changes: 1 addition & 1 deletion src/toad/tool_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def view(self) -> ToolCall:
@staticmethod
def capture_parts(tool_call: schema.ToolCall, *, content=None) -> tuple[ToolOutputPart, ...]:
"""Pure ACP interpretation, shared by live ingress and saved workers."""
raw_input = tool_call.raw_input or {}
raw_input = tool_call.raw_input
path = (
raw_input.get("path") or raw_input.get("file_path") or raw_input.get("filePath")
if isinstance(raw_input, dict) else None
Expand Down
Loading