feat: add Hermes Agent provider - #2965
Conversation
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)
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| let sawModelBlock = false; | ||
|
|
||
| for (const line of lines) { | ||
| const withoutComment = line.replace(/\s+#.*$/, ""); |
There was a problem hiding this comment.
🟡 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.
Summary
Ports the Hermes Agent provider from joeynyc/t3code fork.
isSelectableProviderInstancehelper to consolidate filtering logicSources
Changes
Server
HermesDriver.ts: Provider driver following CursorDriver patternHermesAdapter.ts: ACP adapter for session management (952 lines)HermesProvider.ts: Status checking and snapshot buildingHermesAcpSupport.ts: ACP runtime factoryHermesTextGeneration.ts: Text generation via ACPWeb
providerDriverMeta.ts: Hermes client definitionProviderInstanceCard.tsx: Hermes setup section with binary path detectionproviderStatus.ts: Hermes-specific status copyproviderInstances.ts:isSelectableProviderInstancehelperChatView.tsx: Hermes surface detectionindex.css: Hermes themed chat surface CSSContracts
settings.ts: HermesSettings schemamodel.ts: HERMES_DRIVER_KIND and defaultsserver.ts: suggestedBinaryPath fieldTest plan
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.mjsutility (orthogonal DX improvement)VITE_HTTP_URLhandling (orthogonal DX improvement)Note
Add Hermes as a built-in AI agent provider
binaryPathandcustomModels, and registers Hermes in the contracts layer with default model slugs and display name.resolveSelectableProviderInstancenow requiresstatus === 'ready'andmodels.length > 0in addition to enabled/available; provider selection inChatComposerandModelPickerContentis updated accordingly.isSelectableProviderInstancerequirement 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.