feat: add proto descriptor set and message name to introspect response#909
Open
AnthonyWadham wants to merge 1 commit into
Open
feat: add proto descriptor set and message name to introspect response#909AnthonyWadham wants to merge 1 commit into
AnthonyWadham wants to merge 1 commit into
Conversation
Contributor
Author
How to use the Graphite Merge QueueAdd the label graphite/merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
x-proto-wire
x-proto-wirex-proto-wire
AnthonyWadham
force-pushed
the
Anthony/code-gen-introspect-fix
branch
2 times, most recently
from
July 14, 2026 16:25
7d165d3 to
54350a9
Compare
AnthonyWadham
marked this pull request as ready for review
July 14, 2026 16:49
AnthonyWadham
force-pushed
the
Anthony/code-gen-introspect-fix
branch
from
July 15, 2026 13:39
54350a9 to
a396d2a
Compare
x-proto-wire
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.

TL;DR
Adds proto descriptor metadata to command introspection so clients can encode commands as protobuf without a separately distributed
.protofile.What changed?
Commands now use a dedicated
commandReflectorthat falls back to Go field names (instead ofmsgpacktags) when generating their JSON schema, since proto field names align with Go names rather than msgpack tags.During command registration, the proto descriptor is resolved from the return type of each command's
ToProto()method via reflection — the method is never invoked, only its return type is inspected. The resolvedprotoreflect.MessageDescriptoris stored in a newcommandProtoTypesmap keyed by command name.When
Introspectis called,collectDescriptorSetwalks all resolved descriptors, pulls in transitive file imports (deduplicated by path), and serializes the result as agoogle.protobuf.FileDescriptorSetintoIntrospectResponse.proto_descriptor_set. Each command'sTypeSchemaalso gains aproto_message_namefield carrying the fully-qualified proto message name, so clients can look up the right message in the descriptor set. File ordering is deterministic (sorted by command name before walking) to produce byte-identical output across calls.The proto definitions for
IntrospectResponseandTypeSchemaare updated accordingly, with generated code regenerated for Go, C#, and TypeScript.The existing msgpack-based schema path for components and events is unchanged.
Why make this change?
Clients receiving command schemas from introspection need enough information to encode commands as protobuf on the wire without access to a compiled
.protodescriptor at build time. Shipping theFileDescriptorSetalongside the fully-qualified message name in the introspection response allows clients to construct valid protobuf payloads — for example via protobufjs'sRoot.fromDescriptor— using only what the server advertises at runtime.