feat(dispatch): gateway-free Hermes CLI dispatch provider#737
Open
b-yelverton wants to merge 2 commits into
Open
feat(dispatch): gateway-free Hermes CLI dispatch provider#737b-yelverton wants to merge 2 commits into
b-yelverton wants to merge 2 commits into
Conversation
Routes agents whose dispatchModel is `hermes/<profile>` to the local
`hermes -p <profile> -z <prompt>` one-shot, so a task runs as that real
Hermes agent (its own model/provider/soul) with no API key or gateway.
- pickProvider recognizes the `hermes/` prefix
- callHermesViaCli spawns without a shell; profile validated against
Hermes' own [a-z0-9][a-z0-9_-]{0,63} rule before reaching argv
- routed on the RAW dispatchModel in callDirectly (classifyDirectModel
strips the prefix), leaving anthropic/openai/local paths untouched
- isDirectDispatchAvailable treats an installed hermes binary as a
valid gateway-free backend
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ompt Defense-in-depth on the hermes dispatch path before upstreaming: - cap captured stdout/stderr at 5MB and abort if a child floods it - escalate SIGTERM -> SIGKILL after a 5s grace on timeout/abort - guard a single-settle so overlapping timeout/overflow/close can't double-resolve the promise - refuse to dispatch an empty prompt Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Mission Control already surfaces Hermes observability (sessions, cron, memory, transcripts under
~/.hermes), but there is currently no way to dispatch a task to a Hermes agent — the direct-dispatch providers are Anthropic / OpenAI / local only. This PR completes that loop.An agent whose
config.dispatchModelishermes/<profile>is dispatched by running the Hermes CLI one-shot as that profile:Because a Hermes profile already carries its own model, provider, tools, and SOUL, the task runs as that agent — no model/soul override is injected, no API key is needed, and no gateway is required. It slots into the existing
callDirectlyprovider routing, mirroring the adjacentcallClaudeViaClipath.What changed
pickProviderrecognizes thehermes/prefix (new'hermes'DirectProvider)callHermesViaCli— spawns the CLI shell-free (argv array); profile is validated against Hermes' own^[a-z0-9][a-z0-9_-]{0,63}$rule before it can reach argv or the filesystem profile lookupdispatchModelincallDirectly(sinceclassifyDirectModelstrips the prefix), leaving the anthropic/openai/local paths untouchedisDirectDispatchAvailabletreats an installedhermesbinary as a valid gateway-free backendHERMES_BIN/$HOME/.local/bin//usr/local/bin/ the agent venvHardening (vs the path it mirrors)
SIGTERM→SIGKILLescalation after a 5s grace on timeout/abortTest Plan
Verified end-to-end on a live deployment (Hermes 0.16.0):
hermes/<profile>agent, dispatched via the new path — log showsDispatching task via Hermes CLI→Task dispatched and completed; task reachedquality_reviewwith the agent's real output,dispatch_attempts=0pnpm typecheckcleanCaveats (for maintainer judgement)
hermes -z) — no live streaming or session continuity, unlike a gateway-backed path. Fits queue/batch dispatch, not interactive sessions.hermes/dispatchModel).🤖 Generated with Claude Code