OpenCode Plugin
nexus-routing-guard
v1.0.0PublishedDetects model routing divergence between Nexus-configured agents and the running OpenCode instance's effective provider/model catalog.
Overview
Nexus writes agent-to-provider/model routing into a project's opencode.json, which can silently diverge from what the running OpenCode instance can actually serve; its merged provider catalog is knowledge only the running process has. This plugin compares, once per session, the effective agent routing against the effective provider catalog read directly from the running server via PluginInput.client. Detects two divergence classes: unknown_provider (the agent's provider is not in the instance's catalog at all) and unknown_model (the provider is valid, but the specific model id is not). Silent when clean; a banner only ever fires when something is actually broken.
Registered Hooks
Events this plugin listens to in the OpenCode runtime.
experimental.chat.system.transformBest-effort reliable delivery of a divergence warning into the agent's context.
tool.execute.afterOne-shot deterministic banner injection on the session's first tool call: the guaranteed backstop for the system-prompt mechanism above.