Skip to content

fix: Duplicate tool calls showing in assistant UI#374

Merged
BinaryMuse merged 1 commit intomainfrom
mkt/fix-dupe-tools
Jan 28, 2026
Merged

fix: Duplicate tool calls showing in assistant UI#374
BinaryMuse merged 1 commit intomainfrom
mkt/fix-dupe-tools

Conversation

@BinaryMuse
Copy link
Member

Changes to the history events and system prompts for the AI system causes duplicate tool calls to show up in the UI. This PR fixes that, as well as the system prompt showing up in the UI.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

Fixes duplicate tool calls and system messages appearing in the AI assistant UI by filtering messages on display and checking for existing tool call IDs before adding new ones.

  • Introduced visibleMessages filter in AIAssistant.tsx to hide system messages from UI
  • Added deduplication logic in useAIChat.ts to prevent duplicate tool call messages during history restoration
  • Replaced all messages.length checks with visibleMessages.length for UI logic

Important Files Changed

Filename Overview
src/components/runbooks/editor/ui/AIAssistant.tsx Filters system messages from UI display using useMemo, prevents system prompts from showing to users
src/lib/ai/useAIChat.ts Prevents duplicate tool call messages by checking existing IDs before adding to message list

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@BinaryMuse BinaryMuse merged commit 04252cf into main Jan 28, 2026
4 checks passed
@BinaryMuse BinaryMuse deleted the mkt/fix-dupe-tools branch January 28, 2026 18:11
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant