GraphQL Error in DAP chat when Duo is disabled by default instance-wide or within the group

Checklist

Summary

If Duo is "off by default" for the instance, attempting to open the GitLab Duo Agent Platform (Beta) window in a project that does have Duo enabled will display an error:

Error querying available models: Error: GraphQL request "query: lsp_aiChatAvailableModels" failed with The resource that you are attempting to access does not exist or you don't have permission to perform this action

This occurs if Duo is disabled by default instance wide via the Admin area. This also occurs if Duo is enabled by default on the instance, disabled at the group level but enabled at the project level. In order to avoid this error:

  • Duo must be enabled by default instance-wide
  • Duo must be enabled by default within your top level group
  • Duo must be enabled in your project

Assuming no other configuration issues are present, the Duo Agent Platform chat does still work in this scenario, but it can lead users to think its completely broken.

Steps to reproduce

  1. Ensure Duo is disabled by default via the instance's Admin settings
  2. Create a new group and confirm that Duo is disabled by default in the group settings
  3. Create a new project in the group and enable Duo in the project settings
  4. Clone the project locally and open it VS code
  5. Open the Duo Agent Platform chat and observe the error

To make the error stop appearing:

  1. Enable Duo by default in the instance-wide setting (admin area)
  2. Enable Duo by default in the parent groups settings
  3. Open a new VS Code window for the project, observe no error

What is the current bug behavior?

A confusing GraphQL error is displayed for users in the Duo Agent Platform chat. The chat function should still work, but it leads users to believe it is broken.

What is the expected correct behavior?

A more helpful error message, or if this is not needed, a hidden error message that should instead be logged in the extension logs only.

Relevant logs and/or screenshots

GitLab Language Server stack trace:

2025-11-13T14:29:35:175 [debug]: [WebviewInstanceMessageBus:agentic-duo-chat:a3b1d1e1-2950-4486-999e-1685c63c5a26] Sending notification: setContextCategoriesResult
2025-11-13T14:29:35:175 [error]: Failed to get graphql data for query undefined
    Error: Error querying available models: Error: GraphQL request "query: lsp_aiChatAvailableModels" failed with The resource that you are attempting to access does not exist or you don't have permission to perform this action
        at fallback (/Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_graphql/src/operations/ai/chat/available_models.ts:49:13)
        at wne.execute (/Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_graphql/src/service.ts:54:14)
        at processTicksAndRejections (node:internal/process/task_queues:105:5)
        at getGraphqlData (/Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_webview_agentic_chat/src/plugin/controllers/workflow_common.ts:39:26)
        at /Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_webview_agentic_chat/src/plugin/controllers/setup.ts:16:39
        at r$.handle (/Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_handler_registry/src/registry/simple_registry.ts:36:29)
        at /Users/caleb/.vscode/extensions/gitlab.gitlab-workflow-6.57.1/assets/packages/lib_webview/src/services/connection/webview_instance_message_bus.ts:53:13

Possible fixes

Edited by Caleb Williamson