Skip to content

GitLab Duo workflow fails on self-managed instances #50843

Description

@MJVNOR

Description

GitLab Duo workflow models do not work correctly with a self-managed GitLab instance.

I found two issues while testing this:

  1. Duo workflow models need the current working directory and GitLab project/namespace context.
  2. If the stored GitLab OAuth token is expired and the refresh fails, provider initialization throws and can prevent OpenCode from starting.

I reproduced the OAuth failure with an expired credential where the refresh endpoint returned invalid_grant.

Plugins

None

OpenCode version

0.0.0-dev-202609112115

Steps to reproduce

  1. Configure OpenCode to use a self-managed GitLab instance:

    $env:GITLAB_INSTANCE_URL = "https://gitlab.example.com"
    $env:GITLAB_HOST = "https://gitlab.example.com"
    
  2. Authenticate OpenCode with GitLab OAuth and configure GitLab Duo.

  3. Start OpenCode using the GitLab Duo workflow model:

    opencode -m gitlab/duo-workflow`
    
  4. On a self-managed GitLab instance, start a GitLab Duo workflow and observe that the workflow does not receive the working directory and project/namespace context required for the current repository.

  5. Let the stored GitLab OAuth credentials expire or make the refresh token invalid/revoked, then start OpenCode again.

  6. OpenCode attempts to refresh the expired GitLab OAuth token. If GitLab returns invalid_grant, provider initialization throws and OpenCode can fail to start.

  7. Removing the expired GitLab entries from auth.json allows OpenCode to start again. Re-authenticating restores GitLab access.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal / PowerShell 7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions