perf(skills): speed up snapshot prompt builds - #60339
Closed
dexhunter wants to merge 1 commit into
Closed
Conversation
Fixes NousResearch#3356 Build the skills snapshot manifest in one directory walk, avoid importing gateway session context during CLI prompt startup, and reuse direct platform-list matching for snapshot entries.
kshitijk4poor
added a commit
that referenced
this pull request
Jul 8, 2026
Collaborator
|
Merged via #61131 — your commit was cherry-picked onto current main with your authorship preserved (now e21ba91 on main). Thanks for the contribution! Validation that went into the salvage PR: manifest output byte-identical to main on a nested/support-dir/excluded-dir fixture, ~5.1x faster builds on a 300-skill fixture (24.9ms -> 4.9ms), and an AUTHOR_MAP entry so release attribution resolves to you. Closing this original in favor of the merged salvage. |
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
zach-hermes
pushed a commit
to zach-hermes/hermes-agent
that referenced
this pull request
Aug 16, 2026
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.
Summary
gateway.session_contextduring normal CLI prompt startup.Fixes #3356.
Benchmark
I ran autoresearch with Weco against a strict synthetic skills snapshot harness for the remaining first-turn skills/frontmatter bottleneck.
Weco dashboard: https://dashboard.weco.ai/share/DHk95734hgGIOpYoaXJxh-Vj6TDgWZA7
The harness builds 700 synthetic skills, seeds the disk snapshot, then measures fresh
build_skills_system_promptchild-process calls. It also checks prompt hash stability, platform gating, tool fallback/requirement filtering, and snapshot invalidation after edit/add/delete.hermes_skills_snapshot_prompt_msThat is about an 82% reduction on the measured snapshot prompt-build path.
Validation
uvx ruff check --fix .uv run python -m py_compile agent/prompt_builder.py agent/skill_utils.py tests/agent/test_skill_utils.pyuv run --with pytest --with pytest-timeout python -m pytest tests/agent/test_skill_utils.py::TestSkillMatchesPlatformTermux tests/agent/test_prompt_builder.py -q171 passeduv run python ~/osspr/weco_metric_scripts/NousResearch__hermes_agent_skills_prompt_snapshot/evaluate.py --repo-dir . --iterations 7hermes_skills_snapshot_prompt_ms: 12.2136902064085