SetToolStatus updates the status of the tool call with the given ID, reporting whether an entry was found. The view is recreated so no memoized rendering of the previous status can survive the update.
(callID string, status types.ToolStatus)
| 126 | // reporting whether an entry was found. The view is recreated so no |
| 127 | // memoized rendering of the previous status can survive the update. |
| 128 | func (t *Transcript) SetToolStatus(callID string, status types.ToolStatus) (tea.Cmd, bool) { |
| 129 | for i := range slices.Backward(t.msgs) { |
| 130 | if t.msgs[i].Type != types.MessageTypeToolCall || t.msgs[i].ToolCall.ID != callID { |
| 131 | continue |
| 132 | } |
| 133 | return t.refreshToolView(i, status), true |
| 134 | } |
| 135 | return nil, false |
| 136 | } |
| 137 | |
| 138 | // FinalizeToolCalls flips any tool entry still pending, running, or waiting |
| 139 | // for confirmation to the given terminal status. Defensive: a stream error |