Render agentic Duo Chat from the micro-frontend in the AI panel
What does this MR do and why?
Renders agentic Duo Chat in the AI panel from the Duo Chat micro-frontend (MFE) when mfe_duo_chat_poc is enabled. This proves the Module Federation delivery model end to end on a real surface.
- The panel router redirects the agentic chat routes to new
mfe_poc_routeandmfe_poc_new_routeroutes, which renderMfePocPanel. MfePocPanelloads themfe_duo_chatremote through~/mfe_loaderand mounts it with aGitLabContextbuilt from the page and the panel props.- By default the remote is the copy bundled from
@gitlab-mfe/duo-chat. In development, settingMFE_SERVER_ORIGINloads it from an MFE dev server instead. - Classic chat and the History tab stay native. The selected thread reaches the MFE through the same
sessionStorageentry the native chat reads. - The MFE reports title, subtitle and navigation (open a session, back to history) through DOM
CustomEvents, which the panel forwards.
This is MR 4 of a 4-MR stack, split from !233214:
- Feature flag: !268037 (merged)
- Build and runtime configuration: !268042 (merged)
- Context contract CI job: !268043 (merged)
- Agentic Duo Chat from the MFE in the AI panel (this MR)
References
- gitlab-org#22344
- gitlab-org#22344 (comment 4057432263)
- https://gitlab.com/gitlab-org/frontend/gitlab-mfe/-/blob/main/docs/architecture-rfc.md
- !233214
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
In the Rails console, enable the flag:
Feature.enable(:mfe_duo_chat_poc) -
Open any project page as a user with Duo Agent Platform access, and open the Duo panel in agentic mode.
-
Check that the Chat tab renders the MFE, and that the History tab lists threads and opens the selected one in the MFE.
-
Optional: to test against an MFE dev server, run
pnpm devingitlab-org/frontend/gitlab-mfe, start Rails withMFE_SERVER_ORIGIN=http://localhost:4001, and reload.
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.