Skip to content

feat: Add shell info to agent_user_environment

What does this merge request do and why?

This change adds support for tracking User shell environment information in the AI workflow system. The system can now capture and use details about the command-line shell being used (like bash, zsh, or PowerShell), including its type, variant, environment settings, and whether it's running over an SSH connection. This information gets passed to the AI assistant so it can better understand the user's working environment and provide more appropriate command suggestions and responses.

How to set up and validate locally

You'll need to have local GDK setup with Agentic chat

Then it takes update in 3 projects to have the full flow working

GitLab Rails https://gitlab.com/gitlab-org/gitlab/

  1. In gdk folder cd gitlab
  2. Checkout the branch from this MR git checkout Add-user-agent-context-support The MR was mergedm you can use latest master
  3. Enable the FF guarding agent_user_environment context echo "Feature.enable(:duo_include_context_agent_user_environment)" | rails c

AIGW/DWS https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/

  1. In gdk folder cd gitlab-ai-gateway
  2. Checkout the branch from this MR git checkout Map-client-shell-context-to-prompt 
  3. Navigate cd clients/node
  4. Run yalc push
  5. gdk restart

Language Server project https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp

  1. Checkout the feature branch from this MR git checkout 548507-include-shell-info-in-agentic-prompt
  2. Run npm install
  3. cd packages/lib_workflow_executor
  4. yalc add @gitlab-org/duo-workflow-service
  5. npm install
  6. Link LS in the VSCode extension
  7. Log in with the local gdk user that has access to Agentic Features.
  8. Run extension in dev host
  9. Open project http://gdk.test:3000/gitlab-duo/test
  10. Run Agentic Chat and ask some questions that could detect if the provided shell context is taken into account: "Where should I add my PATH exports?", "What's my CWD". etc.
  11. Note that Shell context is included with the initial chat message and chat is context-aware

Screenshots

Screenshot 2025-08-21 at 13.48.58.png

Related issue

gitlab-org/gitlab#548507 (closed)

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Olena Horal-Koretska

Merge request reports

Loading