feat: add Hermes Agent as core adapter#1867
feat: add Hermes Agent as core adapter#1867HenkDz wants to merge 13 commits intopaperclipai:masterfrom
Conversation
Greptile SummaryThis PR promotes the Hermes Agent adapter from an external npm package ( Confidence Score: 3/5Safe to merge after resolving the dead The core adapter logic (execute, testEnvironment, sessionCodec, skills, detectModel) is well-structured and follows existing adapter conventions. The server migration from the external package is complete and correct. The primary concern is
Important Files Changed
|
| /** | ||
| * Post-process merged assistant message text for Hermes-specific formatting. | ||
| * | ||
| * Hermes conventions differ from standard markdown: | ||
| * - `---` under text = H1 (not H2 as in standard markdown) | ||
| * - `===` under text = H2 (not H1 as in standard markdown) | ||
| * - Tables use `+--+` borders (sometimes `+=+` between header/body) instead of `|---|` | ||
| * | ||
| * GFM (remark-gfm) expects: header row, then a delimiter row, then body rows — not a | ||
| * top/bottom ASCII border before the header. This module converts borders and reorders |
There was a problem hiding this comment.
Dead code —
postProcessMessage is never called
postProcessMessage is defined and exported from this 296-line file, but it is not re-exported from src/ui/index.ts and is not referenced anywhere else in the codebase (verified by searching the entire repo). The UIAdapterModule registered at ui/src/adapters/hermes-local/index.ts has no field for a post-processor, so this module ships as dead code:
// src/ui/index.ts — postProcessMessage is absent:
export { parseHermesStdoutLine } from "./parse-stdout.js";
export { buildHermesConfig } from "./build-config.js";Either wire it up (e.g. export it and pass it to the UIAdapterModule if the platform supports it) or remove the file until it is needed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/adapters/hermes-local/src/ui/post-process.ts
Line: 1-10
Comment:
**Dead code — `postProcessMessage` is never called**
`postProcessMessage` is defined and exported from this 296-line file, but it is not re-exported from `src/ui/index.ts` and is not referenced anywhere else in the codebase (verified by searching the entire repo). The `UIAdapterModule` registered at `ui/src/adapters/hermes-local/index.ts` has no field for a post-processor, so this module ships as dead code:
```ts
// src/ui/index.ts — postProcessMessage is absent:
export { parseHermesStdoutLine } from "./parse-stdout.js";
export { buildHermesConfig } from "./build-config.js";
```
Either wire it up (e.g. export it and pass it to the `UIAdapterModule` if the platform supports it) or remove the file until it is needed.
How can I resolve this? If you propose a fix, please make it concise.9f004b0 to
92be958
Compare
- Remove dead post-process.ts (P1: postProcessMessage never called) - Remove unused KAOMOJI_RE constant from parse-stdout.ts - Fix PR reference #3208 -> #3255 in execute.ts - Remove duplicate JSDoc block on models export in index.ts
- Remove dead post-process.ts (P1: postProcessMessage never called) - Remove unused KAOMOJI_RE constant from parse-stdout.ts - Fix PR reference #3208 -> #3255 in execute.ts - Remove duplicate JSDoc block on models export in index.ts
01fefa8 to
c55d899
Compare
|
Very good! please pull it ASAP! |
c19c616 to
a211a7a
Compare
|
ok Stuck in a loop: A maintainer will need to bypass the policy check — all other jobs (verify, typecheck, build, tests) should pass with the lockfile included. |
|
just remove the pnpm-lock from this commit and it looks good |
7da911e to
60b34c7
Compare
Register hermes_local as a first-class adapter across all UI entry points: - UI adapter module (adapters/hermes-local/) with config fields - Adapter registry (adapters/registry.ts) - All hardcoded enablement sets (AgentConfigForm, OnboardingWizard, NewAgent, NewAgentDialog, InviteLanding) - adapterLabels maps (agent-config-primitives, Agents, OrgChart, InviteLanding) - Command placeholder mapping in AgentConfigForm and OnboardingWizard - Add hermes-paperclip-adapter npm dependency for stdout parsing and config building
…ean dashboard excerpt - Group consecutive non-terminal tools (write, read, search, browser) into collapsible tool_group accordion - Group consecutive terminal/shell tools into command_group (existing pattern) - Restore amber stderr_group accordion for MCP init noise - Clean Latest Run card excerpt: strip markdown headers, tables, code blocks, show first 3 meaningful lines (max 280 chars) instead of raw tool output - Fix parser: filter [tool], [paperclip], session_id, timestamp noise lines; map terminal verbs to 'shell' for command_group compatibility
- Wire listSkills/syncSkills from hermes-paperclip-adapter into server registry - Add collapsible accordion for user-installed (unmanaged) Hermes skills showing count: (N) User-installed skills, not managed by Paperclip - Local file: reference to adapter for both server and UI packages
…_local adapter - Created HermesIcon.tsx: SVG caduceus (winged staff with two serpents + wings) - Updated NewAgentDialog.tsx: replaced Lucide Zap import with HermesIcon - Updated OnboardingWizard.tsx: replaced Lucide Zap import with HermesIcon - Removed unused Zap imports from both files
- server: add detectModel to Hermes adapter registry for auto-detecting configured model/provider - server: add detectAdapterModel() API endpoint for model auto-detection - ui: AgentConfigForm supports creatable free-text model input for hermes_local - ui: auto-detect model from Hermes config and pre-fill model dropdown - package.json: update @henkey/hermes-paperclip-adapter file: link
…ocal - Move hermes-paperclip-adapter source into packages/adapters/hermes-local/ - Create in-tree package.json with workspace:* deps matching other core adapters - Update server registry imports: @henkey/... -> @paperclipai/adapter-hermes-local - Update UI adapter imports: @henkey/... -> @paperclipai/adapter-hermes-local - Remove file: links from server/package.json and ui/package.json - Fix detectModel type widening in adaptersByType Map - All typechecks pass (adapter, server, ui)
- Remove dead post-process.ts (P1: postProcessMessage never called) - Remove unused KAOMOJI_RE constant from parse-stdout.ts - Fix PR reference #3208 -> #3255 in execute.ts - Remove duplicate JSDoc block on models export in index.ts
d68ac23 to
b16c293
Compare
When changing an agent's adapter type (e.g. from CEO to Hermes), the form was replacing the entire adapterConfig with only the new overlay fields, wiping secrets (env), promptTemplate, instructionsFilePath, cwd, timeoutSec, graceSec, and bootstrapPromptTemplate. Now we whitelist adapter-agnostic keys and merge them into the new config so they survive adapter switches. Adapter-specific fields from the old adapter are correctly discarded.
The test environment was only checking process.env for API keys, missing the secrets resolved by the server into ctx.config.env. Now checks config.env first (adapter-configured secrets) then falls back to process.env, matching how other adapters (Claude) handle it. Also adds ZAI_API_KEY to the checked providers and strips inline YAML comments from parsed config values in detect-model.
a1af846 to
a2b77f4
Compare
|
Have you coordinated with NousResearch and @teknium1 on this? Just realizing this doesn't use the upstream package. Is there a good reason to not submit this upstream to https://github.com/NousResearch/hermes-paperclip-adapter i'm not against bringing this into paperclip i guess, it just means we're now responsible for maintaining the hermes-paperclip-adapter. hermes is great so maybe it's not a problem, but i'd want to coordinate with Nous/teknium and make sure they know we were first-partying the adapter -- but that removes control from them if we do this we'd need to notify the upstream repo it's moving to paperclip core |
|
my ideal situation is that you split this into two prs
|
Summary
Adds Hermes Agent (https://github.com/NousResearch/hermes-agent) as a first-party core adapter, joining Claude, Codex, OpenCode, Cursor, Gemini, and Pi.
Hermes Agent is a full-featured open-source AI agent by Nous Research with 30+ native tools (terminal, file, web, browser, vision, etc.), persistent memory, skills, session persistence, MCP support, and multi-provider model routing.
Changes
Core adapter (
packages/adapters/hermes-local/)execute()— spawnshermes chatwith adapter config, tags sessions with--source toolto isolate from user historydetectModel()— auto-detects the user's configured model/provider from~/.hermes/.envlistSkills()/syncSkills()— maps between Hermes skills and Paperclip skillsparseStdoutLine()— parses Hermes output into Paperclip transcript entries (tool_call/tool_result pairs)testEnvironment()— verifieshermesCLI is available and functionalServer (
server/)hermes_localin adapter registry withdetectModelsupportdetectAdapterModel()API endpoint for auto-detecting adapter model/providerENABLED_ADAPTER_TYPESandENABLED_INVITE_ADAPTERSincludehermes_localUI (
ui/)hermesinstead ofclaude)Session isolation
source=toolvia--source toolflag (requires hermes-agent >= 2026.03)hermes sessions list/browse/searchhistoryAdapter configuration doc
The adapter includes a comprehensive
agentConfigurationDocthat guides users through:hermesCLI, API keys){{agentName}},{{taskTitle}}, etc.)Testing
@paperclipai/adapter-hermes-local,@paperclipai/server,@paperclipai/ui