Skip to content

GitLab Duo Agentic Chat not following .gitlab/duo/chat-rules.md despite correct setup

Steps to Reproduce

  1. Create the file .gitlab/duo/chat-rules.md in the project’s default branch (main).

  2. Add valid markdown content containing clear rules, for example:

GitLab Duo Chat Rules & Best Practices

  • Always confirm before modifying existing code.
  • Always append My Name "XYZ" at the end of function docstrings.
  • Never use print for logging; use loguru instead.
  1. Start a new Agentic Chat session using GitLab Duo (via the “+ New Chat” button or /new command).
  2. Ask a prompt that should trigger these rules (e.g. “Write a Python function with a docstring.”)

Expected Behavior

  1. Duo Chat should acknowledge or follow the rules defined in .gitlab/duo/chat-rules.md.

  2. Responses should comply with the constraints (e.g., append name, use loguru, avoid print).

Actual Behavior

  1. Duo Chat ignores the custom rules and behaves as if no .gitlab/duo/chat-rules.md file is present.

  2. No visible acknowledgment of rules being loaded.

  3. Behavior remains unchanged even after restarting chat sessions.

Edited by Vikarsh Singh