fix(github-auth): check ~/.hermes/.env before ~/.git-credentials for token extraction#3466
Merged
teknium1 merged 7 commits intoNousResearch:mainfrom Mar 28, 2026
Merged
Conversation
…token extraction Users who configured their token via `hermes setup` have it stored in ~/.hermes/.env (GITHUB_TOKEN=...), not in ~/.git-credentials. On macOS with osxkeychain as the default git credential helper, ~/.git-credentials may not exist at all, causing silent 401 failures in all GitHub skills. Add ~/.hermes/.env as the first fallback in the auth detection block and the inline "Extracting the Token from Git Credentials" example. Priority order: env var → ~/.hermes/.env → ~/.git-credentials → none Part of fix for NousResearch#3464
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.
Fixes #3464
Problem
Users who configure GitHub via
hermes setuphave their token saved to~/.hermes/.env(asGITHUB_TOKEN=...), but the auth detection code in all GitHub skills only checked~/.git-credentials. On macOS with the defaultosxkeychaincredential helper (and on any system where the store helper isn't in use),~/.git-credentialsdoesn't exist, so the extraction silently returns an empty string and all API calls get a 401 — with no warning to the user.Fix
In all 5 affected skill files, add
~/.hermes/.envas the first fallback (before~/.git-credentials) in the token extraction logic. The priority order is now:ghCLI (command -v gh && gh auth status)$GITHUB_TOKENalready set in the environment~/.hermes/.env— token stored byhermes setup(new)~/.git-credentials— git store helper (existing fallback)AUTH_METHOD=noneFiles changed
skills/github/github-auth/SKILL.md— "Helper: Detect Auth Method" block + inline "Extracting the Token from Git Credentials" exampleskills/github/github-code-review/SKILL.md— inline token extractionskills/github/github-pr-workflow/SKILL.md— inline token extractionskills/github/github-issues/SKILL.md— inline token extractionskills/github/github-repo-management/SKILL.md— inline token extractionDiff pattern (github-auth Helper block)
Diff pattern (4 skill inline blocks)