Bug Report: GitLab Duo Chat - Command Duplication Issue

Bug Report: GitLab Duo Chat - Command Duplication Issue

Summary

GitLab Duo Chat (Beta) duplicates user commands/prompts 2-3 times when executing tool calls, causing confusion and wasted tokens.

Environment

  • GitLab Version: 18.7.0 (GitLab.com SaaS)
  • GitLab Duo Chat: Beta
  • Model: Claude Sonnet 4.5 - Vertex
  • Platform: Windows 11
  • Shell: PowerShell 7 / CMD
  • IDE: VS Code with GitLab Workflow extension

Steps to Reproduce

  1. Open GitLab Duo Chat in VS Code
  2. Send a command that triggers tool execution (e.g., run_command)
  3. Observe the output in terminal

Expected Behavior

Command should execute once and show output once.

Actual Behavior

Command and its output are duplicated 2-3 times in the response.

Example:

User input:

python check_yaml.py

Actual output (duplicated 3 times):

PS C:\Workstation> python check_yaml.py
Total lines: 24
PS C:\Workstation> python check_yaml.py
Total lines: 24
PS C:\Workstation> python check_yaml.py
Total lines: 24

Impact

  • High token usage - wastes user's token budget
  • Confusing UX - hard to read actual output
  • Slower responses - agent waits for duplicate executions

Frequency

  • Happens: Always (100% reproduction rate)
  • Affects: All run_command tool calls
  • Does NOT affect: File operations (read_file, create_file, etc.)

Additional Context

This issue appears to be related to how GitLab Duo Platform handles tool execution callbacks. The agent receives the same command execution result multiple times, possibly due to:

  • Retry logic in the platform
  • Event streaming duplication
  • Tool execution queue processing bug

Workaround

None available. Users must manually parse duplicated output.

Suggested Fix

  • Review tool execution callback mechanism in GitLab Duo Platform
  • Ensure tool results are sent only once to the agent
  • Add deduplication logic for tool execution events
  • Similar to command echo issues in other AI chat platforms
  • May be related to WebSocket/SSE event handling

Reporter: @macar228228 Date: 2025-12-04 Priority: Medium (UX issue, not blocking) Component: GitLab Duo Chat / Agent Platform

Edited by 🤖 GitLab Bot 🤖