Fix agentic chat toggle being hidden when any self-hosted model exists
Problem:
Currently, if any self-hosted model is present in the database, the agentic chat toggle is hidden, and the access check fails due to prevention rules in GlobalPolicy:
Ability.allowed?(root, :access_duo_agentic_chat, project) # => false
This can lead to unintended behavior in hybrid setups. For example, a user may use a self-hosted model (such as Codestral) for code completion but still want to run agent-based chat on GitLab-hosted models. In this case, the agentic chat feature is incorrectly disabled with no UI indication, making it hard to debug.
Update
Fix:
Remove the prevention rules in ee/app/policies/ee/global_policy.rb that were blocking agentic chat access when self-hosted models exist. With hybrid mode now GA, these blanket restrictions are no longer needed.
Action Items:
-
Remove prevention rules in GlobalPolicy -
Update test expectations to match new behavior -
Enable agentic chat toggle visibility in hybrid setups
Related discussion: Slack thread
To be implemented by: @mhamda (or whoever takes it on from groupcustom models)