{"record":{"id":"497b70d9c706d28a","repo":"continuedev/continue","slug":"github-token-not-found","errorCode":null,"errorMessage":"GitHub token not found.","messagePattern":"GitHub token not found\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/providers/GreptileContextProvider.ts","lineNumber":35,"sourceCode":"    type: \"query\",\n  };\n\n  get deprecationMessage() {\n    return \"The Greptile context provider is now deprecated and will be removed in a later version. Please consider viewing their docs at greptile.com/docs/code-review-bot/auto-resolve-with-mcp for resolving greptile queries.\";\n  }\n\n  async getContextItems(\n    query: string,\n    extras: ContextProviderExtras,\n  ): Promise<ContextItem[]> {\n    const greptileToken = this.getGreptileToken();\n    if (!greptileToken) {\n      throw new Error(\"Greptile token not found.\");\n    }\n\n    const githubToken = this.getGithubToken();\n    if (!githubToken) {\n      throw new Error(\"GitHub token not found.\");\n    }\n\n    let absPath = await this.getWorkspaceDir(extras);\n    if (!absPath) {\n      throw new Error(\"Failed to determine the workspace directory.\");\n    }\n\n    var remoteUrl = getRemoteUrl(absPath);\n    remoteUrl = getRemoteUrl(absPath);\n    const repoName = extractRepoName(remoteUrl);\n    const branch = getCurrentBranch(absPath);\n    const remoteType = getRemoteType(remoteUrl);\n\n    if (!remoteType) {\n      throw new Error(\"Unable to determine remote type.\");\n    }\n\n    const options = {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/GreptileContextProvider.ts#L17-L53","documentation":"Companion guard to the Greptile token check: getContextItems throws when getGithubToken() returns nothing. Greptile needs a GitHub token to access the repository, and this provider requires it even before any network call.","triggerScenarios":"Using the greptile provider with no GitHub token in options or the GITHUB_TOKEN / GH_ env vars the provider reads.","commonSituations":"Greptile token configured but GitHub token forgotten; GitHub token set only in gh CLI keyring, not in the environment; fine-grained PAT without repo scope.","solutions":["Set GITHUB_TOKEN (or the provider's GitHub token option) with repo read scope","Verify the token works: curl -H \"Authorization: Bearer $GITHUB_TOKEN\" https://api.github.com/user","Restart the IDE so the backend process inherits the variable"],"exampleFix":"# before: no token\nexport GREPTILE_AUTH_TOKEN=gtp_xxx\n# after\nexport GREPTILE_AUTH_TOKEN=gtp_xxx\nexport GITHUB_TOKEN=ghp_xxx\n","handlingStrategy":"validation","validationCode":"const gh = params.GitHubToken ?? process.env.GITHUB_TOKEN;\nif (!gh) disableProvider('greptile');","typeGuard":null,"tryCatchPattern":"catch (e) { if (/GitHub token/.test(e.message)) promptForToken('GITHUB_TOKEN'); }","preventionTips":["Store both Greptile and GitHub tokens together in a launch env file","Test tokens with a one-line curl before enabling the provider"],"tags":["github","auth","missing-token","env-var"],"backgroundTag":"missing-api-key","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}