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/
- In
gdkfoldercd gitlab -
Checkout the branch from this MRThe MR was mergedm you can use latestgit checkout Add-user-agent-context-supportmaster - Enable the FF guarding
agent_user_environmentcontextecho "Feature.enable(:duo_include_context_agent_user_environment)" | rails c
AIGW/DWS https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/
- In
gdkfoldercd gitlab-ai-gateway - Checkout the branch from this MR
git checkout Map-client-shell-context-to-prompt - Navigate
cd clients/node - Run
yalc push gdk restart
Language Server project https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp
- Checkout the feature branch from this MR
git checkout 548507-include-shell-info-in-agentic-prompt - Run
npm install cd packages/lib_workflow_executoryalc add @gitlab-org/duo-workflow-servicenpm install- Link LS in the VSCode extension
- Log in with the local gdk user that has access to Agentic Features.
- Run extension in dev host
- Open project http://gdk.test:3000/gitlab-duo/test
- 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.
- Note that Shell context is included with the initial chat message and chat is context-aware
Screenshots
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.
