Skip to content

[FEATURE]: integrate GitLab Duo Agent Platform (DAP) workflow models #15577

@vglafirov

Description

@vglafirov

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

OpenCode currently only supports GitLab's agentic chat models (duo-chat-*). GitLab's Duo Agent Platform (DAP) provides server-side agentic workflow models (duo-workflow-*) that drive the agentic loop via the Duo Workflow Service (DWS) WebSocket protocol. These models need to be integrated into OpenCode so users can select and use them alongside existing chat models.

Proposal:

  • Bump @gitlab/gitlab-ai-provider to 4.0.0 which includes GitLabWorkflowLanguageModel, GitLabModelDiscovery, GitLabModelCache, and isWorkflowModel() APIs
  • Add dynamic model discovery that detects the user's GitLab project namespace and queries available DAP models
  • Add a model selection picker when multiple workflow models are available, with file-based caching for preferences
  • Wire DWS tool execution through OpenCode's existing permission-gated tool system
  • Support OAuth instance matching with URL normalization for self-hosted GitLab instances
  • Handle finish event token counting for workflow models

Acceptance criteria:

  • Users can select duo-workflow* models from the model picker
  • Model discovery auto-detects available models for the user's namespace
  • Selected model preference is cached to disk for fast startup
  • DWS tool execution is bridged through OpenCode's tool permission system
  • OAuth tokens are correctly matched to the configured GitLab instance
  • Model banner correctly shows sub-model name only for workflow models
  • All new code uses gitlab- prefix to minimize upstream footprint
  • Test coverage for model selection lifecycle, server routes, provider logic, and processor changes

Replaces #15560 which was auto-closed due to template non-compliance.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions