{"record":{"id":"65c3706db0fdc7bf","repo":"diegosouzapw/OmniRoute","slug":"direct-access-exchange-rejected-401-falling-bac","errorCode":null,"errorMessage":"direct_access exchange rejected (401); falling back to public completions endpoint","messagePattern":"direct_access exchange rejected \\(401\\); falling back to public completions endpoint","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"open-sse/executors/gitlab.ts","lineNumber":586,"sourceCode":"          errorResponse: null,\n        };\n      }\n\n      if (!response) {\n        return {\n          target: {\n            mode: \"monolith\",\n            url: endpoints.publicCompletionsUrl,\n            headers: buildMonolithHeaders(credentials.accessToken),\n          },\n          credentials,\n          errorResponse: null,\n        };\n      }\n\n      if (response.status === 401) {\n        if (input.log) {\n          input.log.warn(\n            \"GITLAB-DUO\",\n            \"direct_access exchange rejected (401); falling back to public completions endpoint\"\n          );\n        }\n        return {\n          target: {\n            mode: \"monolith\",\n            url: endpoints.publicCompletionsUrl,\n            headers: buildMonolithHeaders(credentials.accessToken || null),\n          },\n          credentials,\n          errorResponse: null,\n        };\n      }\n\n      if (response.status === 403 && !isGitLabDirectAccessDisabled(response.status, bodyText)) {\n        return {\n          target: null,","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/gitlab.ts#L568-L604","documentation":"The GitLab Duo direct_access token exchange returned 401, so the executor abandons the direct-access path and falls back to the public completions endpoint using the existing access token. Expected degradation mode for tokens/scopes that lack direct-access eligibility; the request continues on the monolith endpoint instead of failing.","triggerScenarios":"Thrown at open-sse/executors/gitlab.ts:586 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No immediate action — fallback keeps the request flowing","Refresh GitLab credentials if the public endpoint also starts failing","Verify OAuth token scopes if direct-access mode is required"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}