Skip to content

Commit 02de9a1

Browse files
committed
add runts to the toolcall data...
1 parent 1075526 commit 02de9a1

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

frontend/app/aipanel/aitypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type WaveUIDataTypes = {
1717
toolname: string;
1818
tooldesc: string;
1919
status: "pending" | "error" | "completed";
20+
runts?: number;
2021
errormessage?: string;
2122
approval?: "needs-approval" | "user-approved" | "user-denied" | "auto-approved" | "timeout";
2223
blockid?: string;

pkg/aiusechat/uctypes/usechat-types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type UIMessagePart struct {
6767
ProviderMetadata map[string]any `json:"providerMetadata,omitempty"`
6868
}
6969

70+
// when updating this struct, also modify frontend/app/aipanel/aitypes.ts WaveUIDataTypes.userfile
7071
type UIMessageDataUserFile struct {
7172
FileName string `json:"filename,omitempty"`
7273
Size int `json:"size,omitempty"`
@@ -135,11 +136,13 @@ const (
135136
ApprovalAutoApproved = "auto-approved"
136137
)
137138

139+
// when updating this struct, also modify frontend/app/aipanel/aitypes.ts WaveUIDataTypes.tooluse
138140
type UIMessageDataToolUse struct {
139141
ToolCallId string `json:"toolcallid"`
140142
ToolName string `json:"toolname"`
141143
ToolDesc string `json:"tooldesc"`
142144
Status string `json:"status"`
145+
RunTs int64 `json:"runts,omitempty"`
143146
ErrorMessage string `json:"errormessage,omitempty"`
144147
Approval string `json:"approval,omitempty"`
145148
BlockId string `json:"blockid,omitempty"`

pkg/aiusechat/usechat.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ func processToolCallInternal(toolCall uctypes.WaveToolCall, chatOpts uctypes.Wav
349349
_ = sseHandler.AiMsgData("data-tooluse", toolCall.ID, *toolCall.ToolUseData)
350350
updateToolUseDataInChat(chatOpts, toolCall.ID, toolCall.ToolUseData)
351351
}
352-
352+
353+
toolCall.ToolUseData.RunTs = time.Now().UnixMilli()
353354
result := ResolveToolCall(toolCall, chatOpts)
354355

355356
if result.ErrorText != "" {

0 commit comments

Comments
 (0)