File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,10 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
255255 cmd := p .messages .AddToolResult (msg , types .ToolStatusCompleted )
256256
257257 // Check if this is a todo-related tool call and update sidebar
258- // Only update after successful execution (in response, not during call)
259- toolName := msg .ToolCall .Function .Name
260- if toolName == "create_todo" || toolName == "create_todos" ||
261- toolName == "update_todo" || toolName == "list_todos" {
258+ if msg .ToolDefinition .Category == "todo" {
262259 // Only update if the response doesn't contain an error
263260 // Response starting with "Error calling tool:" indicates failure
261+ // TODO: We should maybe use the mcp types, they have an "IsError" field.
264262 if len (msg .Response ) < 19 || msg .Response [:19 ] != "Error calling tool:" {
265263 _ = p .sidebar .SetTodos (msg .ToolCall )
266264 }
You can’t perform that action at this time.
0 commit comments