You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Thanks for updating your PR! It now meets our contributing guidelines. 👍
This branch has not been deployed
No deployments
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
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
Closes #50843
Type of change
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-providerto 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 typecheckpasses.400 invalid_grantwhen OpenCode attempted to refresh the expired OAuth token.GitLab OAuth refresh failed; disabling GitLab provider for this sessionand continued initializing normally instead of failing startup.gitlab-ai-providercan detect the GitLab project context from the repository remote.Screenshots / recordings
N/A - no UI changes.
Checklist