Draft: Add automatic model routing toggle to agentic chat [ci skip]
⚠️ Demo only. The AI gateway does not yet return the routed model to the client, so theAuto → <model>label is produced by a client-side mock (auto_routing_demo_mock.js) that mirrors the gateway's keyword-routing intent. This is intended for others to try the experience, not for production. The routing plumbing needs to be replaced with real gateway data before this ships.
What does this MR do and why?
Adds an Automatic model routing toggle to the agentic chat model selection dropdown so people can let the gateway pick a model per request instead of choosing one manually. When auto routing is on:
- the dropdown toggle shows
Auto(andAuto → <model>once a routed model is known); - the listbox selection is cleared so no stale model row stays checked;
- picking a model manually turns auto routing back off.
This MR is pushed for others to try out the experience.
References
[UX] Surface the routed model to end-users when... (#629273) • Austin Regnery
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag in a Rails console:
Feature.enable(:duo_developer_model_routing) - Open GitLab Duo agentic chat and open the model selection dropdown.
- Toggle Automatic model routing on — the button label switches to
Autoand the model selection clears. - Send a prompt; the label resolves to
Auto → <model>(mocked from the prompt text). - Pick a model manually — auto routing turns off again.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.