Repository navigation
fix(providers): fall back to public Code Suggestions endpoint on GitLab Duo direct_access 401 (#10365) - #10499
Merged
Conversation
…ab Duo direct_access 401 (#10365)
Collaborator
Author
|
The executor-side 401 fallback is sensible for normal requests, but the reported failure also occurs when clicking Retest. In PR head, OAUTH_TEST_CONFIG still probes only /code_suggestions/direct_access, and the generic test handler still treats a 401 as “Token invalid or revoked”; it never invokes GitlabExecutor, so this PR cannot change that behavior. Please extend the fallback to the connection-test path and add a regression test for it. I ran the focused executor suite only on the review workspace (6/6); PR-head execution was not performed. |
… path (#10365) The chat-completion path (open-sse/executors/gitlab.ts) already falls back to the public Code Suggestions completions endpoint when the direct_access exchange is rejected with 401, but testOAuthConnection() / the dashboard Retest button still reported the connection unhealthy on the same 401 — even though a real chat request through that connection would have succeeded via the fallback. Apply the identical fallback contract to the connection-test path (first attempt and the post-refresh retry), sharing the predicate with the executor via shouldFallbackToPublicCodeSuggestions.
diegosouzapw
pushed a commit
that referenced
this pull request
Aug 19, 2026
…pool and the ESLint gate (#10726) * fix(tests): drain the auto/glm base-red left by the Cloudflare Playground backend provider-family-combos asserted a fixed provider list for auto/glm and started failing on release/v3.8.50 once the Cloudflare AI Playground no-auth backend landed: its registry advertises zai-org/glm-5.2 and zai-org/glm-4.7-flash, so the virtual combo legitimately spans it. The test already documents the rule it is failing on — a no-auth backend that genuinely serves a family model IS a member of the family pool — and carries that justification for auggie, devin-cli-agentic and zcode. Add cloudflare-playground to the expectation with the same kind of source-cited note. * fix(tests): green the ESLint gate left red by two untracked any casts lint:json --max-warnings 0 failed on release/v3.8.50 because the suppression counts drifted behind the tree: cli-oauth-commands carried 20 no-explicit-any violations against a registered 18 (#10491 added two Commander-mock casts) and executor-gitlab carried 5 against a registered 4 (#10499 added one). The GitLab test casts are fixable, so they are fixed rather than suppressed: all five now read the translated payload through a declared GitLabResponseBody instead of any, and the file leaves the suppression list entirely. The CLI OAuth casts target bin/cli/commands/oauth.mjs, which ships no types, so the Commander mock has nothing to cast to; that entry only gets its count corrected to the 20 already in the tree.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ab Duo direct_access 401 (cheaper-inference#10365) (cheaper-inference#10499) * fix(providers): fall back to public Code Suggestions endpoint on GitLab Duo direct_access 401 (cheaper-inference#10365) * fix(providers): extend GitLab Duo 401 fallback to the connection-test path (cheaper-inference#10365) The chat-completion path (open-sse/executors/gitlab.ts) already falls back to the public Code Suggestions completions endpoint when the direct_access exchange is rejected with 401, but testOAuthConnection() / the dashboard Retest button still reported the connection unhealthy on the same 401 — even though a real chat request through that connection would have succeeded via the fallback. Apply the identical fallback contract to the connection-test path (first attempt and the post-refresh retry), sharing the predicate with the executor via shouldFallbackToPublicCodeSuggestions. --------- Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…pool and the ESLint gate (cheaper-inference#10726) * fix(tests): drain the auto/glm base-red left by the Cloudflare Playground backend provider-family-combos asserted a fixed provider list for auto/glm and started failing on release/v3.8.50 once the Cloudflare AI Playground no-auth backend landed: its registry advertises zai-org/glm-5.2 and zai-org/glm-4.7-flash, so the virtual combo legitimately spans it. The test already documents the rule it is failing on — a no-auth backend that genuinely serves a family model IS a member of the family pool — and carries that justification for auggie, devin-cli-agentic and zcode. Add cloudflare-playground to the expectation with the same kind of source-cited note. * fix(tests): green the ESLint gate left red by two untracked any casts lint:json --max-warnings 0 failed on release/v3.8.50 because the suppression counts drifted behind the tree: cli-oauth-commands carried 20 no-explicit-any violations against a registered 18 (cheaper-inference#10491 added two Commander-mock casts) and executor-gitlab carried 5 against a registered 4 (cheaper-inference#10499 added one). The GitLab test casts are fixable, so they are fixed rather than suppressed: all five now read the translated payload through a declared GitLabResponseBody instead of any, and the file leaves the suppression list entirely. The CLI OAuth casts target bin/cli/commands/oauth.mjs, which ships no types, so the Commander mock has nothing to cast to; that entry only gets its count corrected to the 20 already in the tree.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #10365
GitLab Duo's
/code_suggestions/direct_accessexchange can return 401 (token invalid/revoked); previously that aborted the request with an opaque 401 instead of trying the public/code_suggestions/completionsendpoint — the same resilience already wired for the 403-disabled case. @codex-composerRoot cause:
GitlabExecutorhandled 401 from direct_access as terminal (target: null+ error response), so a revoked/invalid Duo token surfaced immediately with no fallback despite the public completions endpoint being available.Fix: on direct_access 401, retry the monolith
endpoints.publicCompletionsUrlviabuildMonolithHeaders(mirrors the existing 403-disabled fallback).errorResponse: nullon the direct exchange — the fallback is the real response.Regression test (RED→GREEN):
tests/unit/executor-gitlab.test.ts— new casefalls back … when direct_access returns 401asserts the call sequencedirect_access → completionsand that the completions body is returned (7/7 pass).Gates: typecheck:core exit 0 · eslint (suppressions) exit 0 · check-file-size OK · check-complexity OK · check-cognitive-complexity OK · check-changelog-integrity OK · executor-gitlab.test.ts 7/7 GREEN.