-
Notifications
You must be signed in to change notification settings - Fork 9.4k
feat: add Hermes Agent integration (with review fixes) #2651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
majordave
wants to merge
11
commits into
github:main
Choose a base branch
from
majordave:feat/hermes-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6a17aab
feat: add Hermes Agent integration
Zhaoxiaoguang001 cd91046
feat: add Hermes Agent integration
Zhaoxiaoguang001 e83cd54
feat: add Hermes Agent integration
Zhaoxiaoguang001 541b278
feat: add Hermes Agent integration (with review fixes)
majordave f19a57e
feat: write Hermes skills directly to global ~/.hermes/skills/
majordave 70f5732
fix: address Copilot review feedback on Hermes integration
majordave a5fd163
Merge upstream/main into feat/hermes-integration (local only, no push)
majordave 6e9af2b
fix: address second Copilot review round — 6 remaining observations
majordave 3da5e0b
fix: add first-class global/home-based agent dir support in CommandRe…
majordave b938619
fix: address remaining 3 Copilot review observations (round 3)
majordave a90862b
fix: address Copilot round 4 — home-relative dir resolution + project…
majordave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -654,15 +654,28 @@ def _resolve_agent_dir( | |
| ) -> Path: | ||
| """Return the agent command directory, falling back to legacy_dir. | ||
|
|
||
| When the canonical directory (``agent_config["dir"]``) does not | ||
| exist but a ``legacy_dir`` is configured and present on disk, | ||
| returns the legacy path and emits a deprecation warning advising | ||
| the user to upgrade. | ||
| Supports project-relative paths (e.g. ``.claude/skills/``), | ||
| home-relative paths (e.g. ``~/.hermes/skills``), and absolute | ||
| paths — the ``agent_config["dir"]`` value is resolved verbatim | ||
| when absolute or starting with ``~/``, or joined with | ||
| ``project_root`` when relative. | ||
|
|
||
| When the canonical directory does not exist but a ``legacy_dir`` | ||
| is configured and present on disk, returns the legacy path and | ||
| emits a deprecation warning advising the user to upgrade. | ||
|
|
||
| Integrations that do not declare ``legacy_dir`` get the canonical | ||
| path unconditionally — no fallback, no warning. | ||
| """ | ||
| agent_dir = project_root / agent_config["dir"] | ||
| dir_str = agent_config["dir"] | ||
| if dir_str.startswith("~"): | ||
| # Use Path.home() + remainder instead of expanduser() so tests | ||
| # that monkeypatch Path.home() can properly isolate the home dir. | ||
| # expanduser() uses OS env/user lookup and ignores monkeypatches. | ||
| agent_dir = Path.home() / dir_str[1:].lstrip("/") | ||
| else: | ||
| p = Path(dir_str) | ||
| agent_dir = p if p.is_absolute() else project_root / p | ||
|
Comment on lines
+670
to
+678
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in a90862b — |
||
| if not agent_dir.exists(): | ||
| legacy = agent_config.get("legacy_dir") | ||
| if legacy: | ||
|
|
@@ -704,6 +717,15 @@ def register_commands_for_all_agents( | |
|
|
||
| self._ensure_configs() | ||
| for agent_name, agent_config in self.AGENT_CONFIGS.items(): | ||
| # Check detect_dir first (project-local marker) if configured, | ||
| # falling back to the resolved dir for output. This prevents | ||
| # global dirs (e.g. ~/.hermes/skills) from causing false | ||
| # detection in every project. | ||
| detect_dir_str = agent_config.get("detect_dir") | ||
| if detect_dir_str: | ||
| detect_path = project_root / detect_dir_str | ||
| if not detect_path.exists(): | ||
| continue | ||
| agent_dir = self._resolve_agent_dir( | ||
| agent_name, agent_config, project_root, | ||
| ) | ||
|
|
@@ -755,6 +777,11 @@ def register_commands_for_non_skill_agents( | |
| for agent_name, agent_config in self.AGENT_CONFIGS.items(): | ||
| if agent_config.get("extension") == "/SKILL.md": | ||
| continue | ||
| detect_dir_str = agent_config.get("detect_dir") | ||
| if detect_dir_str: | ||
| detect_path = project_root / detect_dir_str | ||
| if not detect_path.exists(): | ||
| continue | ||
| agent_dir = self._resolve_agent_dir( | ||
| agent_name, agent_config, project_root, | ||
| ) | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in b938619 — integration_switch Phase 1 now calls current_integration.teardown(project_root, old_manifest, force=force) instead of old_manifest.uninstall() + remove_context_section(), matching the pattern used in integration_uninstall. Custom teardown logic (Hermes global skills, etc.) now runs during switches.