Identify the plugin and its version to the API#10
Merged
Conversation
The SDK announces itself in the User-Agent and accepts a caller token ahead of its own, but the plugin never set one, so an inbound request was indistinguishable from any other TypeScript SDK caller. Without that there is no way to tell which plugin, or which version of it, a given agent is running. Pass userAgentPrefix where the client is constructed, sourced from package.json at runtime so it cannot drift from the declared version. Version is realigned to 0.2.5, the shared number across the plugin fleet, so the token identifies a fleet release rather than a per-repo count.
alex-w-99
force-pushed
the
feat/plugin-user-agent
branch
from
July 27, 2026 02:35
946de49 to
5623fe7
Compare
alex-w-99
marked this pull request as ready for review
July 27, 2026 02:40
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
The SDK announces itself in the
User-Agentand accepts a caller token ahead of its own, but the plugin never set one, so its requests were indistinguishable from any other TypeScript SDK caller. There was no way to tell which plugin, or which version of it, a given agent was running.This is the opencode half of a fleet-wide change; the other four plugins carry the same change alongside an inbound-email fix. This repo does not need that fix — its email path already reads
message.received'sbodyfield (src/gateway/dispatch.ts), so only the User-Agent and version work applies here.What's here
pluginUserAgent()yieldsinkbox-opencode/<version>, passed asuserAgentPrefixwhere the client is constructed, producinginkbox-opencode/<version> inkbox-typescript/<sdk version>.package.jsonat runtime viacreateRequire, not hardcoded, so the token cannot drift from the declared version.tscemits todist/, so the relative path resolves from both the build output and the source tree.User-Agentheader is already sent on every request. It fills in a field that was previously blank.Version
Realigned to 0.2.5, the shared number across the plugin fleet. Previously each repo counted independently (0.2.4 / 0.2.2 / 0.1.4 / 0.1.3 / 0.1.0), so a version told you nothing about which fleet release you were on. 0.2.5 is one above the previous fleet maximum, so every repo moves strictly up and no version number is reused for different content. This is the largest jump of the five (0.1.0 to 0.2.5) purely because this repo counted from the lowest starting point; it carries no implication about the size of this change.
Tests
tests/user-agent.test.tsasserts the token matches the package version and is stable across calls. Full suite: 644 passed,tsc --noEmitclean.