-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
Problem
When a tool call completes during streaming, the tool_call_response event includes rich result information:
// pkg/runtime/event.go
type ToolCallResponseEvent struct {
Type string `json:"type"`
ToolCall tools.ToolCall `json:"tool_call"`
ToolDefinition tools.Tool `json:"tool_definition"`
Response string `json:"response"`
Result *tools.ToolCallResult `json:"result,omitempty"` // ← Contains isError, meta
AgentContext
}
// pkg/tools/tools.go
type ToolCallResult struct {
Output string `json:"output"`
IsError bool `json:"isError,omitempty"` // ← Lost in REST API
Meta any `json:"meta,omitempty"` // ← Lost in REST API
}However, when retrieving a session via GET /sessions/:id, the response only contains chat.Message which stores tool responses as:
// pkg/chat/chat.go - Message struct
Content string `json:"content"` // Only the output string
ToolCallID string `json:"tool_call_id"` // Reference to tool call
// No isError field
// No meta field
The example above is for result in tool_call_response. But there are also other attributes as well, such as toolDefinition.
Ideally we should be able to have the same level of information between events vs API
Metadata
Metadata
Assignees
Labels
No labels