Skip to content

Fix bare JSON visualization of proposed command runs in Duo Agentic Chat

Summary

Running commands in Duo Agentic Chat in the IDE and Web UI renders the raw command strings as JSON array blob. This feels overwhelming, especially when users are not familiar with how Linux/Unix or Windows commands executed, and what program and args as keys actually mean.

This creates a cognitive overload to understand what is happening, and gets worse when raw command calls to create an issue or MR are shown, which include the long raw Markdown body, overfloating the entire Chat history.

Note: I am labeling this as a bug because the UX is bare and IMHO a bug in the UI.

Steps to reproduce

  1. Ensure that GitLab Duo Agentic Chat is available (subscription, Beta settings)
  2. Fork/import https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-agent-platform/challenges/challenge-cpp-observability-sensor into a Duo Enterprise namespace
  3. Clone the project into VS Code or JetBrains CLion with Duo
  4. Open Duo Agent Platform with Chat
  5. Ask How to build this project to enforce a series of commands
  6. Ask Please fix this project and create an MR with the changes to trigger a remote MR creation
  7. Ask Please create an issue, detailing how to add a new hardware sensor for humidity monitoring to trigger the issue creation

Example Project

https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-agent-platform/challenges/challenge-cpp-observability-sensor

What is the current bug behavior?

The command approval box renders the raw JSON command with arguments. This overwhelms the Duo Agentic Chat UI, and creates a negative user experience.

The order of entries is also counter-intuitive, as I would read a terminal command from left-to-right, or top-to-bottom. The args are listed first, program last. This requires to reverse the command in your brain to understand what it does (if you can, with Linux terminal knowlege).

What is the expected correct behavior?

Commands are rendered informative to the user, reducing cognitive overload to understand what agentic tool calls would actually execute.

  1. Create a short summary of what the command does (ask the LLM to generate this for the tool call, if not directly available from the tool description).
  2. Add a hideable form where users can click to show more details including the raw command line
  3. Implement "Duo should remember approvals" to reduce the required reading and understanding times. #556045
  4. Hardcode a map of common tool calls and do not show the raw commands for them.
    1. Creating directories and files
    2. Creating issues and MRs

Relevant logs and/or screenshots

image.png

Above is the end of the following series

image.png

image.png

image.png

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

 (For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`)  (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)  

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`)

(For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)

(we will only investigate if the tests are passing)

Possible fixes

Implement a visual representation of tool commands in the GitLab Duo Chat webview components.

  1. Summary of the executed command
  2. Raw command line for shorter commands
  3. Detailed pane to click on to see the verbose output

Include command syntax highlighting for better visual representation, aiding the eye.

Cursor example:

image.png

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

cc @timzallmann @sarahwaldner @bastirehm