Skip to content

AP-25179-Agent-Chat-Widget-shows-message-placeholder#36

Open
ya-hn wants to merge 2 commits intomasterfrom
AP-25179-Agent-Chat-Widget-shows-message-placeholder
Open

AP-25179-Agent-Chat-Widget-shows-message-placeholder#36
ya-hn wants to merge 2 commits intomasterfrom
AP-25179-Agent-Chat-Widget-shows-message-placeholder

Conversation

@ya-hn
Copy link
Contributor

@ya-hn ya-hn commented Feb 4, 2026

Previously, errors would block the user from making new requests due to the empty poll handling.

@ya-hn ya-hn requested a review from a team as a code owner February 4, 2026 16:39
@ya-hn ya-hn requested review from Copilot and knime-ghub-bot and removed request for a team February 4, 2026 16:39
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 fixes an issue where error messages weren't properly terminating the loading state, causing the chat widget to block users from making new requests. The fix ensures that error messages are treated as terminal messages alongside AI messages without tool calls.

Changes:

  • Modified terminal message detection to include error messages
  • Added comprehensive test coverage for error message handling in the loading state

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/agents/chat_app/src/stores/chat.ts Updated addMessages to treat error messages as terminal, triggering finishLoading
src/agents/chat_app/src/stores/tests/chat.test.ts Added test suite covering terminal message handling for both AI and error messages

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

store.config = createConfig();

const errorMessage = createErrorMessage("Task failed successfully");
store.addMessages([errorMessage as any], true);
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The as any type assertion bypasses type safety. If createErrorMessage returns a type incompatible with Message[], consider updating the type definition or the function signature instead of using a type assertion.

Suggested change
store.addMessages([errorMessage as any], true);
const errorMessages = [errorMessage] as unknown as Parameters<typeof store.addMessages>[0];
store.addMessages(errorMessages, true);

Copilot uses AI. Check for mistakes.
@ya-hn ya-hn force-pushed the AP-25179-Agent-Chat-Widget-shows-message-placeholder branch from 6929b5d to a2e538f Compare February 10, 2026 16:55
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.

1 participant