feat: enable GitLab Agent Platform with dynamic model discovery#18012
Closed
vglafirov wants to merge 1 commit intoanomalyco:devfrom
Closed
feat: enable GitLab Agent Platform with dynamic model discovery#18012vglafirov wants to merge 1 commit intoanomalyco:devfrom
vglafirov wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found 1 related PR that should be reviewed: Related PR:
Why it's related: This PR also addresses GitLab Duo Agent Platform (DAP) workflow model integration. Since #18012 is a more recent implementation with dynamic model discovery and workflow routing, you should verify whether #15573 is already merged, closed, or if there's overlap in the implementation approach that should be consolidated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enable GitLab Agent Platform (Duo Workflow Service) integration with dynamic model discovery, workflow model routing, and local tool execution.
Changes
Package Migration
@gitlab/gitlab-ai-providerv3.6.0 with unscopedgitlab-ai-providerv5.1.2Dynamic Model Discovery (
provider.ts)CustomDiscoverModelstype anddiscoveryLoadersregistry so providers can dynamically register models at runtimediscoverModels(providerID)function with a per-provider cache that:GitLabProjectDetectorto detect the current GitLab project fromprocess.cwd()namespaceId(group)GitLabModelDiscovery.discover()to fetch selectable, default, and admin-pinned models for that namespaceGitLabModelConfigRegistryfor context/output token limits per modelduo-workflow-*entries with full capability metadata (reasoning, attachments, tool calls, image/PDF input)Workflow Model Routing (
provider.ts)duo-workflow-*model IDs throughsdk.workflowChat()instead ofsdk.agenticChat()workflowRefoption for selecting a specific upstream model referenceMODEL_MAPPINGSare respected; unknown refs get a generatedduo-workflow-{ref}ID{ ...provider.options, ...model.options })Workflow Tool Executor (
session/llm.ts)GitLabWorkflowLanguageModel, atoolExecutorcallback is wired upServer Routes (
config.ts,provider.ts)/configand/providerroutes now triggerProvider.discoverModels()for all connected providers before returning responsesFeature Flags
duo_agent_platform_agentic_chatandduo_agent_platformare enabled by default for GitLab providerTesting
models-api.jsontest fixture to reflect the new npm package name (gitlab-ai-provider)