Skip to content

fix: support GitLab Duo workflows on self-managed instances - #50844

Open
MJVNOR wants to merge 2 commits into
anomalyco:devfrom
MJVNOR:fix/gitlab-duo-self-managed
Open

MJVNOR wants to merge 2 commits into
anomalyco:devfrom
MJVNOR:fix/gitlab-duo-self-managed

Conversation

@MJVNOR

@MJVNOR MJVNOR commented Sep 23, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #50843

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes GitLab Duo workflows on self-managed GitLab instances.

The GitLab provider now uses the configured instance URL when refreshing OAuth credentials and passes the current working directory to Duo workflow models, allowing gitlab-ai-provider to automatically detect the GitLab project context from the repository remote.

It also handles expired OAuth credentials gracefully. If the OAuth refresh fails, GitLab is disabled for the current session instead of preventing OpenCode from starting.

How did you verify your code works?

Tested locally on Windows with a self-managed GitLab instance.

  • bun run --cwd packages/opencode typecheck passes.
  • Built the Windows executable successfully; the build smoke test passed.
  • Tested startup with stored GitLab OAuth credentials that were already expired.
  • Confirmed GitLab returned 400 invalid_grant when OpenCode attempted to refresh the expired OAuth token.
  • Confirmed OpenCode logged GitLab OAuth refresh failed; disabling GitLab provider for this session and continued initializing normally instead of failing startup.
  • Verified workflow models receive the current working directory so gitlab-ai-provider can detect the GitLab project context from the repository remote.

Screenshots / recordings

N/A - no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, here are potentially related PRs:

  1. fix(gitlab): discover workflow models in v2 - This addresses GitLab workflow model discovery, which is directly related to the workflow initialization changes in PR fix: support GitLab Duo workflows on self-managed instances #50844.

  2. feat(core): restore GitLab workflow discovery and add OAuth login - This PR deals with GitLab workflow discovery and OAuth login functionality, which overlaps with the OAuth credential handling and workflow initialization in the current PR.

These PRs may share similar concerns around GitLab workflow setup and OAuth handling, though PR #50844 specifically focuses on self-managed instance support with expired credential handling.

@MJVNOR
MJVNOR marked this pull request as draft September 23, 2026 06:22
@MJVNOR
MJVNOR force-pushed the fix/gitlab-duo-self-managed branch from 79fc541 to 1f782e5 Compare September 23, 2026 07:07
@MJVNOR
MJVNOR marked this pull request as ready for review September 23, 2026 07:12
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab Duo workflow fails on self-managed instances

1 participant