Gatewarden Nexus
Docs
Plugins
What's new
Roadmap
Tools
Your Nexus
Plugins/nexus-attribution-headers

OpenCode Plugin

nexus-attribution-headers

v1.0.0Published

Injects x-nexus-session-id / x-nexus-primary-slot / x-nexus-actor-slug attribution headers on outgoing requests to the Nexus gateway provider.

Overview

The Nexus gateway records model_usage_events / route_decision_events for cost and routing analytics, but session and actor attribution were entirely missing (null on every gateway row) because nothing on the OpenCode side emitted the headers the gateway was built to read. This plugin closes that gap via the chat.headers hook, which fires immediately before a chat completion request is sent: it attaches x-nexus-session-id always, x-nexus-primary-slot for the nexus-plan/nexus-act/nexus-review primary agents, and x-nexus-actor-slug verbatim for every other agent (including OpenCode's own internal calls). Attribution-only; never used for routing or authentication on the gateway side. Scoped exclusively to requests where the provider id is nexus; every other provider is left untouched.

Registered Hooks

Events this plugin listens to in the OpenCode runtime.

chat.headers

The only hook this plugin implements: it fires immediately before an outgoing chat completion request and injects the attribution headers directly into it.

Technical Details

DistributionTypeScript source via nexus pull into .opencode/plugins/, no npm install required.
RequiresNothing beyond the standard plugin context; no Nexus MCP session required.
Hard constraintsNever blocks or breaks a request on missing/malformed input; stateless; scoped exclusively to the nexus provider.

Plugin Info

Version
v1.0.0
Hooks
1
Custom Tools
0
Plans
All

Source Code

View the full source, report issues, or contribute on GitHub.

View repository

Links

  • All plugins
  • Plugin collection repo
  • Nexus CLI (nexusctl)
  • Pricing
  • Developer docs
Back to pluginsView on GitHub

Get started

Ready to put specifications first?
Start building with Nexus.

Governed specs drive your agents. No ad-hoc prompts, no vibe coding.

Sign in with GitHub
Gatewarden Nexus

Platform

  • Documentation
  • Tools
  • What's new
  • Roadmap
  • Pricing

Resources

  • MCP Server
  • CLI
  • GitHub

Company

  • RelicFrog
  • Imprint

Legal

  • Privacy policy
  • Terms of service
© 2026 RelicFrog Holding UG (haftungsbeschränkt)·v0.17.2 (aea217e)
a Gatewarden product by RelicFrog Holding UG