Skip to content

feat: add Hermes Agent provider - #2965

Closed
Mokson wants to merge 7 commits into
pingdotgg:mainfrom
Mokson:feat/hermes-agent-provider
Closed

feat: add Hermes Agent provider#2965
Mokson wants to merge 7 commits into
pingdotgg:mainfrom
Mokson:feat/hermes-agent-provider

Conversation

@Mokson

@Mokson Mokson commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Ports the Hermes Agent provider from joeynyc/t3code fork.

  • Adds full Hermes provider support (driver, adapter, ACP runtime, text generation)
  • Adds Hermes settings schema and configuration UI
  • Adds themed chat surface for Hermes (golden/amber color scheme)
  • Adds isSelectableProviderInstance helper to consolidate filtering logic
  • Adds provider documentation

Sources

  • Fork: joeynyc/t3code (13 commits ahead)
  • Reference quality verdict: good (port the design as-is)
  • Port strategy: adapt (same design, mechanical conflicts)

Changes

Server

  • HermesDriver.ts: Provider driver following CursorDriver pattern
  • HermesAdapter.ts: ACP adapter for session management (952 lines)
  • HermesProvider.ts: Status checking and snapshot building
  • HermesAcpSupport.ts: ACP runtime factory
  • HermesTextGeneration.ts: Text generation via ACP
  • Tests for provider and ACP support

Web

  • providerDriverMeta.ts: Hermes client definition
  • ProviderInstanceCard.tsx: Hermes setup section with binary path detection
  • providerStatus.ts: Hermes-specific status copy
  • providerInstances.ts: isSelectableProviderInstance helper
  • ChatView.tsx: Hermes surface detection
  • index.css: Hermes themed chat surface CSS

Contracts

  • settings.ts: HermesSettings schema
  • model.ts: HERMES_DRIVER_KIND and defaults
  • server.ts: suggestedBinaryPath field

Test plan

  • All 1058 tests pass
  • Typecheck passes
  • Lint passes (only pre-existing warnings)
  • Manual: Enable Hermes in settings
  • Manual: Verify provider card expands with setup instructions
  • Manual: Verify themed chat surface when Hermes selected

Validation evidence

Provider appears in settings with "Early Access" badge and expandable configuration.

Scope exclusions

The following changes from the reference fork were excluded (separate PRs):

  • dev-watch.mjs utility (orthogonal DX improvement)
  • VITE_HTTP_URL handling (orthogonal DX improvement)

Note

Add Hermes as a built-in AI agent provider

  • Adds a full Hermes provider driver (HermesDriver.ts) with binary auto-detection, CLI health checks, auth status parsing, and snapshot enrichment via version advisory.
  • Adds a Hermes adapter (HermesAdapter.ts) that manages ACP sessions, turn prompting with image attachments, permission mediation, cancellation, and rollback.
  • Adds Hermes-backed text generation (HermesTextGeneration.ts) for commit messages, PR content, branch names, and thread titles via structured JSON output over ACP.
  • Adds settings schema for binaryPath and customModels, and registers Hermes in the contracts layer with default model slugs and display name.
  • Adds a Hermes-specific chat surface theme and setup UI in ProviderInstanceCard.tsx, including a suggested binary path control and CLI command copy rows.
  • resolveSelectableProviderInstance now requires status === 'ready' and models.length > 0 in addition to enabled/available; provider selection in ChatComposer and ModelPickerContent is updated accordingly.
  • Risk: the new isSelectableProviderInstance requirement may cause previously selectable provider instances (ready but with no models) to silently fall through to the next candidate.
📊 Macroscope summarized a1b1604. 21 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

Add HermesSettings schema and supporting constants for the Hermes
Agent provider. This prepares the contracts layer for the server
driver implementation in the next commit.

Changes:
- Add HermesSettings schema with binaryPath and customModels fields
- Add HermesSettingsPatch for settings updates
- Add HERMES_DRIVER_KIND constant and model defaults
- Add suggestedBinaryPath field to ServerProvider for binary detection
- Update KeybindingsToast test fixture with hermes entry
Add the Hermes Agent (`hermes`) provider driver and all supporting infrastructure:

- HermesDriver: Provider driver following CursorDriver patterns exactly
- HermesAdapter: ACP adapter for session management via `hermes acp`
- HermesProvider: Provider status checking and snapshot building
- HermesAcpSupport: ACP runtime factory for spawning Hermes CLI
- HermesTextGeneration: Text generation (commit messages, PR content) via ACP
- Unit tests for HermesProvider and HermesAcpSupport

The driver integrates with the existing AcpSessionRuntime infrastructure
and supports all standard provider features: session management, turn
streaming, permission requests, plan updates, and text generation.
Add Hermes provider support to the web UI:

- Add Hermes client definition in providerDriverMeta.ts
- Add Hermes-specific status copy in providerStatus.ts
- Add isSelectableProviderInstance helper to providerInstances.ts
- Update ChatComposer.tsx to use new helper for instance filtering
- Update ModelPickerContent.tsx to filter non-selectable instances

The isSelectableProviderInstance helper consolidates the filtering logic
that requires a provider to be enabled, available, ready, and have
models before appearing in the model picker.
Add golden/amber Hermes-themed chat surface styling:

- Add .chat-surface-hermes CSS class with grid overlay pattern
- Add Hermes sigil pseudo-element decoration
- Include dark mode variant with adjusted opacity and blend modes
- Update ChatView.tsx to detect Hermes selection and apply theme

The themed surface activates when Hermes is selected as the active
provider, providing visual distinction for Hermes conversations.
- Add docs/providers/hermes.md with installation, configuration, and
  troubleshooting guide
- Update README.md to mention Hermes in the supported providers list
- Link to the Hermes setup documentation from README

The documentation covers the recommended macOS setup flow: cloning the
upstream project, creating a stable binary path, and running hermes model
to configure the default model that T3 Code will display.
Update ProviderRegistry.test.ts to expect 5 providers (adding hermes).
Update providerInstances.test.ts fixtures to include models, as the
new isSelectableProviderInstance helper requires models.length > 0.
Add the missing Hermes-specific UI elements from the reference:
- Import KeyboardEvent and MouseEvent types
- Add isInteractiveEventTarget helper for click handling
- Add ProviderSetupCommandRow component for setup commands
- Add suggestedBinaryPath and isHermesDriver variables
- Add applySuggestedBinaryPath handler for detected path
- Add toggleExpanded, handleHeaderClick, handleHeaderKeyDown handlers
- Add hermesSetupNode with setup instructions and commands
- Make header div clickable with proper ARIA attributes
- Use relative URL for docs (docs/providers/hermes.md)
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 38159db6-84b4-4307-a209-5caa685adf6a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Jun 5, 2026
@Mokson Mokson closed this Jun 5, 2026
@Mokson
Mokson deleted the feat/hermes-agent-provider branch June 5, 2026 05:14
@Mokson
Mokson restored the feat/hermes-agent-provider branch June 5, 2026 05:15
let sawModelBlock = false;

for (const line of lines) {
const withoutComment = line.replace(/\s+#.*$/, "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium Layers/HermesProvider.ts:79

Full-line comments starting with # at column 0 are not stripped by the regex /\s+#.*$/ on line 79, which requires leading whitespace before #. When a comment appears between model: and default: at indent 0, the block exit check on line 92 fires prematurely, setting inModelBlock = false and causing default: to be missed. The parser returns { defaultModel: null, malformed: true } instead of finding the default value.

-    const withoutComment = line.replace(/\s+#.*$/, "");
+    const withoutComment = line.replace(/\s+#.*$/, "").replace(/^#.*$/, "");
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/Layers/HermesProvider.ts around line 79:

Full-line comments starting with `#` at column 0 are not stripped by the regex `/\s+#.*$/` on line 79, which requires leading whitespace before `#`. When a comment appears between `model:` and `default:` at indent 0, the block exit check on line 92 fires prematurely, setting `inModelBlock = false` and causing `default:` to be missed. The parser returns `{ defaultModel: null, malformed: true }` instead of finding the default value.

Evidence trail:
apps/server/src/provider/Layers/HermesProvider.ts lines 72-104 (REVIEWED_COMMIT): line 79 regex `/\s+#.*$/` requires leading whitespace before `#`; line 80 skips only empty lines; line 88 sets `modelIndent = 0`; line 92 checks `indent <= modelIndent` which triggers for indent-0 comment lines that survived the regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants