Skip to content

chore(hermesagent): e2e matrix coverage, MCP config DRY, and cleanups#2047

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-2044-hermesagent-followup
Jun 25, 2026
Merged

chore(hermesagent): e2e matrix coverage, MCP config DRY, and cleanups#2047
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-2044-hermesagent-followup

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

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 hermesagent

Added hermesagent happy-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.md
  • e2e-skills.spec.ts — new global-mode row: ~/.hermes/skills/test-skill/SKILL.md
  • e2e-subagents.spec.ts — new global-mode row: ~/.hermes/rulesync/subagents/planner.json
  • e2e-hooks.spec.ts — dedicated global-mode test asserting the hook command paths survive under hooks.rulesync in ~/.hermes/config.yaml
  • e2e-permissions.spec.ts — dedicated global-mode test asserting the command_allowlist and permissions.rulesync map in ~/.hermes/config.yaml, plus non-destructive merge of unrelated keys

Hermes 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-config module

hermesagent-mcp.ts no longer keeps its own parseHermesConfig or serializes via raw dump(merged). It now uses the shared parseHermesConfig / stringifyHermesConfig from hermes-config.ts (the same helpers used by hooks/permissions/subagents), so every feature writing ~/.hermes/config.yaml produces identical formatting (sortKeys: false + trailing newline), preventing idempotency/diff churn. Existing MCP unit tests pass unchanged.

Low-severity cleanups

  • Collapsed the duplicate HERMESAGENT_MCP_FILE_NAME / HERMESAGENT_CONFIG_FILE_NAME constants (both "config.yaml") into a single HERMESAGENT_CONFIG_FILE_NAME; updated references.
  • Added a unit test for HermesagentSkill (the only new Hermes class lacking one).
  • Removed the dead ?? commandSlug(...) fallback in hermesagent-command.ts (basename never returns nullish).
  • Reverted let toolFiles back to const in generate.ts (never reassigned).
  • Removed the redundant "shouldMergeExistingFileContent" in aiFile && typeof ... === "function" guard in feature-processor.ts; the method is declared on the AiFile base class. Updated the test mock to include it.

Verification

  • pnpm cicheck is fully green (fmt, oxlint, typecheck, 6953 unit tests, content checks).
  • All 362 tests across the five affected e2e specs pass, including the new hermesagent cases.

Closes #2044

🤖 Generated with Claude Code

…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>
@dyoshikawa dyoshikawa merged commit 10913dc into main Jun 25, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa dyoshikawa deleted the resolve-scrap-issue-2044-hermesagent-followup branch June 25, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-up from PR #2026: Hermes Agent e2e matrix coverage, MCP config DRY, and cleanups

2 participants