Skip to content

fix: agentic chat resolve input not clearing after submission

What does this MR do?

This MR fixes a bug where the chat input field would not clear after sending a message in Agentic Chat, leaving the previous message text visible in the input area.

Will fix: gitlab#550599 (closed)

Screenshots or screen recordings

before after
2025-06-27_13-23-52 2025-06-27_13-23-15

Root Cause

The issue was caused by a race condition in the sendChatPrompt() method:

  1. User sends a message
  2. canSubmit is set to false, disabling the textarea
  3. setPromptAndFocus() attempts to clear the prompt asynchronously
  4. Disabled textarea prevents the v-model binding from updating the DOM
  5. Input appears to still contain the previous message

Solution

  • Made sendChatPrompt() async and added await before setPromptAndFocus()
  • This ensures the prompt clearing completes before the textarea gets disabled
  • Proper execution order: emit → clear → disable
Edited by Jannik Lehmann

Merge request reports

Loading