feat: enable GitLab Agent Platform with workflow model discovery#18014
Merged
rekram1-node merged 24 commits intoanomalyco:devfrom Mar 20, 2026
Merged
feat: enable GitLab Agent Platform with workflow model discovery#18014rekram1-node merged 24 commits intoanomalyco:devfrom
rekram1-node merged 24 commits intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate PR found:
Consider reviewing PR #15573 to check:
|
Route handlers were triggering discoverModels for all connected providers, causing unnecessary network calls and potential hangs. Only the gitlab provider has a discovery loader, so restrict the call to gitlab when it is connected.
- Add experimental notice and license requirements - Update admin setup instructions with current GitLab docs links - Remove hardcoded featureFlags from config example - Add DAP workflow models documentation section - Migrate npm package references to unscoped names - Apply changes across English and 17 translated locales
Replace @gitlab/opencode-gitlab-auth@1.3.3 with opencode-gitlab-auth@2.0.0.
…gitlab-ai-provider to 5.2.2 Move discoverModels call from config.ts and provider.ts routes into state() initialization so discovery runs once at startup. Upgrade gitlab-ai-provider to 5.2.2 which caches discovery results to disk with a 10-minute TTL, avoiding redundant GraphQL calls.
…overy, and toolExecutor
Discovery now runs inside state() init, making the exported discoverModels() and its cache dead code. Remove both along with the corresponding tests.
Collaborator
|
Note to self: We are merging for now to unblock gitlab, later we should move all this logic so that it can be done via plugin hooks rather than hardcoding provider specific logic in places like llm.ts |
HacknBashe
pushed a commit
to HacknBashe/opencode
that referenced
this pull request
Mar 21, 2026
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.
Issue for this PR
Enables GitLab Agent Platform support with dynamic workflow model discovery.
Type of change
What does this PR do?
This PR adds full support for the GitLab Agent Platform in opencode, including dynamic workflow model discovery and tool execution over WebSocket.
Key changes:
Package migration: Replaced
@gitlab/gitlab-ai-provider(v3.6.0) with the renamedgitlab-ai-provider(v5.2.0) — the package was moved out of the@gitlabnpm scope.Dynamic workflow model discovery (
provider.ts):CustomDiscoverModelstype anddiscoverModelsfield to the custom provider loader interface.discoverModels(), which callsdiscoverWorkflowModels()from the SDK. This queries the GitLab instance for available workflow models based on the current project context (working directory / git remote).Workflow model routing (
provider.ts):duo-workflow-are routed throughsdk.workflowChat()instead ofsdk.agenticChat().isWorkflowModel()utility from the SDK determines whether a static mapping exists; otherwise falls back toduo-workflowwith aselectedModelRef.options(e.g.workflowRef) are now merged and passed through to the model loader.Tool executor wiring (
session/llm.ts):GitLabWorkflowLanguageModel, atoolExecutorcallback is attached. This allows the remote workflow service to invoke opencode's local tools (file read/write, shell, etc.) and receive results back over the WebSocket connection.Lazy discovery in API routes (
server/routes/config.ts,server/routes/provider.ts):Provider.discoverModels()for all connected providers before returning the provider list, ensuring freshly discovered models appear in the UI.Feature flags: The
duo_agent_platformandduo_agent_platform_agentic_chatfeature flags are now set by default for all GitLab provider requests.How did you verify your code works?
gitlab-ai-providerdependency.workflowChat()and tool calls from the workflow service execute locally via thetoolExecutorbridge.agenticChatmodels continue to work unchanged.Screenshots / recordings
N/A — backend/provider changes, no UI modifications.
Checklist