Skip to content

fix(skills): use Git Trees API to prevent silent subdirectory loss during install#2995

Merged
teknium1 merged 2 commits intomainfrom
hermes/hermes-2cdc8d39
Mar 25, 2026
Merged

fix(skills): use Git Trees API to prevent silent subdirectory loss during install#2995
teknium1 merged 2 commits intomainfrom
hermes/hermes-2cdc8d39

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Salvage of PR #2981 by @tugrulguner. Fixes #2940.

When installing a skill from GitHub, _download_directory() made one Contents API call per subdirectory, recursing into each. If any per-directory call failed silently (rate limits, timeouts, large directories returning non-200), those subdirectory files were simply omitted — no error, no log.

Changes

  • Refactors _download_directory() to use the Git Trees API as the primary path (single call for the entire repo tree), falling back to the recursive Contents API when the tree endpoint is unavailable or truncated
  • Added debug logging for failed subdirectory/file fetches
  • 7 new tests covering tree API happy path, all fallback triggers, and recursive fallback behavior

Follow-up fix

Simplified the tree API call by passing the branch name directly to git/trees/{branch}?recursive=1 instead of resolving commit SHA via an extra git/ref/heads/ call. This matches the pattern already used by _find_skill_in_repo_tree() from #2980.

Test plan

All 73 skills hub tests pass. Full suite: 6157 passed (2 pre-existing streaming test failures from #2980, unrelated).

tugrulguner and others added 2 commits March 25, 2026 10:41
…ring install

Refactors _download_directory() to use the Git Trees API (single call
for the entire repo tree) as the primary path, falling back to the
recursive Contents API when the tree endpoint is unavailable or
truncated.  Prevents silent subdirectory loss caused by per-directory
rate limiting or transient failures.

Cherry-picked from PR #2981 by tugrulguner.
Fixes #2940.
Eliminates an extra git/ref/heads API call by passing the branch name
directly to git/trees/{branch}?recursive=1, matching the pattern
already used by _find_skill_in_repo_tree.
@teknium1 teknium1 merged commit fba73a6 into main Mar 25, 2026
InB4DevOps pushed a commit to InB4DevOps/hermes-agent that referenced this pull request Mar 25, 2026
…ring install (NousResearch#2995)

* fix(skills): use Git Trees API to prevent silent subdirectory loss during install

Refactors _download_directory() to use the Git Trees API (single call
for the entire repo tree) as the primary path, falling back to the
recursive Contents API when the tree endpoint is unavailable or
truncated.  Prevents silent subdirectory loss caused by per-directory
rate limiting or transient failures.

Cherry-picked from PR NousResearch#2981 by tugrulguner.
Fixes NousResearch#2940.

* fix: simplify tree API — use branch name directly as tree-ish

Eliminates an extra git/ref/heads API call by passing the branch name
directly to git/trees/{branch}?recursive=1, matching the pattern
already used by _find_skill_in_repo_tree.

---------

Co-authored-by: tugrulguner <tugrulguner@users.noreply.github.com>
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…ring install (NousResearch#2995)

* fix(skills): use Git Trees API to prevent silent subdirectory loss during install

Refactors _download_directory() to use the Git Trees API (single call
for the entire repo tree) as the primary path, falling back to the
recursive Contents API when the tree endpoint is unavailable or
truncated.  Prevents silent subdirectory loss caused by per-directory
rate limiting or transient failures.

Cherry-picked from PR NousResearch#2981 by tugrulguner.
Fixes NousResearch#2940.

* fix: simplify tree API — use branch name directly as tree-ish

Eliminates an extra git/ref/heads API call by passing the branch name
directly to git/trees/{branch}?recursive=1, matching the pattern
already used by _find_skill_in_repo_tree.

---------

Co-authored-by: tugrulguner <tugrulguner@users.noreply.github.com>
StreamOfRon pushed a commit to StreamOfRon/hermes-agent that referenced this pull request Mar 29, 2026
…ring install (NousResearch#2995)

* fix(skills): use Git Trees API to prevent silent subdirectory loss during install

Refactors _download_directory() to use the Git Trees API (single call
for the entire repo tree) as the primary path, falling back to the
recursive Contents API when the tree endpoint is unavailable or
truncated.  Prevents silent subdirectory loss caused by per-directory
rate limiting or transient failures.

Cherry-picked from PR NousResearch#2981 by tugrulguner.
Fixes NousResearch#2940.

* fix: simplify tree API — use branch name directly as tree-ish

Eliminates an extra git/ref/heads API call by passing the branch name
directly to git/trees/{branch}?recursive=1, matching the pattern
already used by _find_skill_in_repo_tree.

---------

Co-authored-by: tugrulguner <tugrulguner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants