chore(hermesagent): e2e matrix coverage, MCP config DRY, and cleanups#2047
Merged
Merged
Conversation
…eanups Follow-up from PR #2026: - Add `hermesagent` happy-path rows to the five e2e Tool x Feature specs (commands/skills/hooks/permissions/subagents). Hermes is global-only, so the cases live in each spec's global-mode block; hooks/permissions assert on the shared ~/.hermes/config.yaml. - Consolidate `hermesagent-mcp.ts` onto the shared `hermes-config.ts`: drop the private `parseHermesConfig` and `dump(...)` calls in favor of the shared `parseHermesConfig` / `stringifyHermesConfig`, so all features that write ~/.hermes/config.yaml serialize identically (sortKeys:false + trailing newline) and avoid idempotency churn. - Collapse the duplicate `HERMESAGENT_MCP_FILE_NAME` / `HERMESAGENT_CONFIG_FILE_NAME` constants into a single `HERMESAGENT_CONFIG_FILE_NAME` and update references. - Add a unit test for `HermesagentSkill`. - Remove the dead `?? commandSlug(...)` fallback in `hermesagent-command.ts` (`basename` never returns nullish). - Revert `let toolFiles` back to `const` in `generate.ts` (never reassigned). - Drop the redundant `"shouldMergeExistingFileContent" in aiFile && typeof ...` guard in `feature-processor.ts`; the method is declared on the `AiFile` base class. Update the test mock accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
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
Follow-up work from PR #2026 (Hermes Agent support). Addresses all findings tracked in the issue.
[high] e2e Tool x Feature matrix coverage for
hermesagentAdded
hermesagenthappy-path cases to the five e2e specs so the features introduced in PR #2026 are covered (project guidelines require this matrix to be preserved):e2e-commands.spec.ts— new global-mode row:~/.hermes/skills/review-pr/SKILL.mde2e-skills.spec.ts— new global-mode row:~/.hermes/skills/test-skill/SKILL.mde2e-subagents.spec.ts— new global-mode row:~/.hermes/rulesync/subagents/planner.jsone2e-hooks.spec.ts— dedicated global-mode test asserting the hook command paths survive underhooks.rulesyncin~/.hermes/config.yamle2e-permissions.spec.ts— dedicated global-mode test asserting thecommand_allowlistandpermissions.rulesyncmap in~/.hermes/config.yaml, plus non-destructive merge of unrelated keysHermes Agent is global-only for every feature (
supportsProject: false), so all cases live in each spec's global-mode block.[mid] Unify MCP serialization on the shared
hermes-configmodulehermesagent-mcp.tsno longer keeps its ownparseHermesConfigor serializes via rawdump(merged). It now uses the sharedparseHermesConfig/stringifyHermesConfigfromhermes-config.ts(the same helpers used by hooks/permissions/subagents), so every feature writing~/.hermes/config.yamlproduces identical formatting (sortKeys: false+ trailing newline), preventing idempotency/diff churn. Existing MCP unit tests pass unchanged.Low-severity cleanups
HERMESAGENT_MCP_FILE_NAME/HERMESAGENT_CONFIG_FILE_NAMEconstants (both"config.yaml") into a singleHERMESAGENT_CONFIG_FILE_NAME; updated references.HermesagentSkill(the only new Hermes class lacking one).?? commandSlug(...)fallback inhermesagent-command.ts(basenamenever returns nullish).let toolFilesback toconstingenerate.ts(never reassigned)."shouldMergeExistingFileContent" in aiFile && typeof ... === "function"guard infeature-processor.ts; the method is declared on theAiFilebase class. Updated the test mock to include it.Verification
pnpm cicheckis fully green (fmt, oxlint, typecheck, 6953 unit tests, content checks).hermesagentcases.Closes #2044
🤖 Generated with Claude Code