Skip to content

Conversation

@rSnapkoOpenOps
Copy link
Collaborator

Fixes OPS-3293.

@linear
Copy link

linear bot commented Jan 14, 2026

@sonarqubecloud
Copy link

@rSnapkoOpenOps rSnapkoOpenOps marked this pull request as ready for review January 14, 2026 13:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the sendAutomaticallyWhen logic in the assistant UI chat hook by checking all messages for tool-ui outputs rather than only examining the last message.

Changes:

  • Refactored message checking logic from inspecting only the last message to iterating through all messages using some()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +284 to 291
return messages.some((message) =>
message?.parts?.some(
(part) =>
part?.type?.includes('tool-ui') &&
'output' in part &&
!!part.output,
),
);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Checking all messages and all parts on every invocation could be inefficient as the message history grows. Consider tracking tool-ui state separately or limiting the search to recent messages if the intention is to detect new tool-ui outputs rather than any historical ones.

Copilot uses AI. Check for mistakes.
@rSnapkoOpenOps rSnapkoOpenOps marked this pull request as draft January 14, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants