feat(hermes): ship the Opper session-root / affinity provider plugin#17
Merged
Conversation
8295db0 to
195c83a
Compare
`opper launch hermes` now installs a dedicated `opper` provider plugin into its
isolated HERMES_HOME on each launch and configures Hermes to use it, so Hermes
authenticates and emits the headers Opper needs for session grouping + provider
affinity.
- data/hermes-opper-plugin/{__init__.py,plugin.yaml}: a Hermes model-provider
plugin registering a first-class `opper` provider. On every request it emits
X-Opper-Trace-Id and X-Opper-Parent-Span-Id (= uuid5(session_id), with a
per-process fallback when Hermes passes no session_id). The trace id groups a
session's calls into one trace and drives provider affinity (sticky provider
for prompt-cache reuse across turns); the matching parent-span id makes Opper
auto-create one "session" root span and nest each turn under it, so the trace
renders as a tree instead of N sibling roots.
- hermes.ts: write `model.provider: opper` and the matching `providers.opper`
block, and writeOpperPlugin() copies the plugin into HERMES_HOME on spawn
(rewritten each launch so CLI upgrades ship plugin changes). `model.provider`
and the providers entry share the same key on purpose: Hermes resolves the
request-time api key from the ACTIVE provider's key_env, so a name mismatch
leaves the provider with no key and Hermes sends a "no-key-required"
placeholder that Opper rejects with 401.
Requires the task-api session-root change (opper-ai/opper#2921) deployed first:
without it the parent-span header points at a not-yet-existing span and the
child spans are dropped on the FK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
195c83a to
4abe5a2
Compare
This was referenced Jun 15, 2026
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.
What
opper launch hermesnow ships a dedicatedopperprovider plugin into its isolatedHERMES_HOMEon each launch, and points Hermes at it. Together this makes a Hermes session render as one session-root tree in Opper traces (and pins each session to one provider for prompt-cache reuse).Changes
data/hermes-opper-plugin/{__init__.py,plugin.yaml}— a Hermes model-provider plugin registering a first-classopperprovider. On every request it emits:X-Opper-Trace-Id = uuid5(session_id)— groups the session's calls into one trace + drives provider affinity.X-Opper-Parent-Span-Id =the same id — makes Opper auto-create onesessionroot span and nest each turn under it (tree instead of N sibling roots).session_id(e.g. one-shot-z), so a launch still shares one trace.hermes.ts— writemodel.provider: opper+ a matchingproviders.opperblock, andwriteOpperPlugin()copies the plugin intoHERMES_HOME/plugins/model-providers/opper/onspawn(via the existingassetPath()/data/pattern; rewritten each launch so CLI upgrades ship plugin changes).key_env.model.providerand theproviders.*entry are deliberately bothopper; a mismatch leaves the active provider with no key, so Hermes sends ano-key-requiredplaceholder → Opper 401.Test
providers.opper/model.provider: opper/ plugin-dir assertions updated.tscclean.sessionroot + per-turnllmchildren landed in one trace.Land + deploy the task-api session-root change (opper-ai/opper#2921) first. Until it's live, the
X-Opper-Parent-Span-Idheader points at a not-yet-existing span and the child spans are dropped on thepublic.spans.parent_uuidFK. The plugin's affinity behavior is independent and safe either way.🤖 Generated with Claude Code