Add GitLab Duo provider support#428
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the CLIProxyAPI's capabilities by integrating GitLab Duo as a fully supported AI provider. The changes enable seamless authentication via OAuth or PAT, dynamic discovery of available models, and intelligent routing of requests through GitLab's AI gateway to the appropriate underlying model (Anthropic or OpenAI/Codex). This improves the user experience by offering a more native and flexible interaction with GitLab Duo's AI services, moving beyond simple text wrapping to a more deeply integrated and performant solution. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Thanks for the redirect. I ported the GitLab Duo work to CLIProxyAPIPlus and rebased it onto . The provider support, gateway routing, smoke tests, and docs are all included here now.\n\nValidation:\n- targeted GitLab Duo packages pass\n- full ? github.com/router-for-me/CLIProxyAPI/v6/cmd/server [no test files] goroutine 105 [running]: |
|
Thanks for the redirect. I ported the GitLab Duo work to CLIProxyAPIPlus and rebased it onto plus/main. This PR now contains the provider support, gateway routing, smoke tests, and docs. Validation:
|
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive GitLab Duo support to CLIProxyAPI, enabling OAuth and Personal Access Token (PAT) authentication, dynamic model discovery, and routing through GitLab's AI gateway for Anthropic and OpenAI models. The changes include new command-line flags for login, a dedicated authentication package, and an executor that handles request translation, streaming, and token refreshing, with fallback mechanisms. New documentation for setup and usage has also been added. Review comments suggest improving the streaming implementation to avoid a potentially degraded user experience when falling back to synthetic streaming, and recommend using more descriptive variable names for gitlabLogin and gitlabTokenLogin to enhance code clarity.
Note: Security Review did not run due to the size of the PR.
| } else if !shouldFallbackToCodeSuggestions(streamErr) { | ||
| return nil, streamErr | ||
| } |
There was a problem hiding this comment.
The code currently falls back to synthetic streaming if real streaming fails. However, the comment indicates that synthetic streaming is not good enough for codex parity. This could lead to a degraded user experience. Consider implementing a more robust streaming solution or explicitly declining the request if real streaming is unavailable.
| var gitlabLogin bool | ||
| var gitlabTokenLogin bool |
Summary
Port GitLab Duo support to
CLIProxyAPIPlusafter maintainer guidance that third-party provider work belongs in this repository.This PR adds:
direct_accessmetadata and managed credentialsTransport behavior
GitLab Duo now routes by provider-aware transport instead of relying only on the GitLab text wrapper APIs:
ClaudeExecutorCodexExecutor/v1/messages,/v1/chat/completions, and/v1/responsesare covered by smoke testsTesting
Targeted GitLab Duo packages:
go test ./internal/auth/gitlab ./internal/runtime/executor ./sdk/api/handlers/claude ./sdk/api/handlers/openai ./sdk/auth ./sdk/cliproxyFull suite note:
go test ./...currently fails on cleanplus/mainininternal/api/modules/ampplus/mainwith:go test ./internal/api/modules/amp -run TestModifyResponse_GzipScenarios/skips_non_2xx_status -count=1