Sync Go SDK with Plugin API v3.7.0 protocol fields#11
Merged
dmortondev merged 7 commits intomainfrom Mar 30, 2026
Merged
Conversation
Two fields present in the C++ Job type were absent from the Go SDK: - InitContainer type and initContainers on Job, so plugins can receive and process init container specs from job submissions. - InstanceID on Job, preserving the Launcher instance identifier used in load-balanced deployments. Also add supportsInitContainers to the ClusterInfo response so plugins can advertise init container capability to the Launcher.
The MultiCluster extension (message type 17, MultiClusterPlugin, MultiClusterResponseWriter, WriteClusters, ClusterInfo.Name) was a prototype that went in a different direction and is not part of the Launcher Plugin API. Remove it entirely.
The C++ Launcher reads memoryUsageBytes from the MetricsResponse but the Go SDK never populated it, so Go plugins always reported zero for memory usage. Add MemoryUsageBytes to PluginMetrics so plugins can report current process memory, and wire it through to the MetricsResponse payload.
The C++ Mount struct has an optional name field that is serialized when non-empty, but Go's Mount had no equivalent. Add Name string with omitempty to match the C++ wire format.
Queue and Constraints lacked omitempty, causing Go to always emit "queue": "" and "placementConstraints": null even for profiles with neither. C++ only sends these fields when non-empty.
JobStatusStreamResponse has always had a "name" field, but NewJobStatusStreamResponse never populated it — the field was silently zero-valued on every status update. C++ plugins always send the job name (from the full Job object via JobStatusStream::getJobStatusJson), and the Launcher passes it through to Workbench in the raw JSON. Add a name parameter to WriteJobStatus, thread it through the protocol constructor, and update the cache to supply job.Name from the stored job. Also adds Name to the internal statusUpdate struct and to plugintest's StatusUpdate so tests can assert on it.
Wire Job.StatusCode through the status streaming path so plugins can forward cluster-specific status codes (e.g. Kubernetes pod phase) to the Launcher, matching C++ plugin behavior.
479a7c0 to
4ed02ba
Compare
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
Audits the Go SDK against the canonical C++ Launcher and first-party plugin implementations to close gaps between the wire protocol and what the SDK exposed. All changes match observed C++ behavior.
InitContainertype andJob.InitContainers— init containers run before the main job container when the cluster advertisessupportsInitContainers. IncludesJob.InstanceID(Launcher-assigned persistent identifier that plugins must round-trip unchanged), andMount.Name(optional label for a file system mount).MultiClusterextension — therequestMultiClusterInfo/responseMultiClusterInfomessage types (wire value 17) were removed from the protocol. The request handler and response writer method have been deleted accordingly.memoryUsageBytesto metrics —PluginMetrics.MemoryUsageBytesandMetricsResponse.memoryUsageByteswere missing. The Launcher always reads this field; zero is treated as unknown rather than a measurement of zero bytes.ResourceProfileserialization —QueueandConstraintswere missingomitempty, causing them to always serialize even when empty. C++ only sends these fields conditionally.nameandstatusCodeto job status stream responses —WriteJobStatusnow acceptsnameandstatusCode, matchingJobStatusStream::getJobStatusJsonin the C++ SDK.statusCodeis forwarded fromJob.StatusCodethrough thestatusUpdatepub/sub path and omitted when empty;nameis always sent (matching C++ behavior).Breaking changes
launcher.StreamResponseWriter.WriteJobStatushas a new signature:Plugins that implement
StreamResponseWriterdirectly (rather than delegating to the cache helpers) must add thestatusCodeparameter. Pass an empty string if the scheduler does not use status codes.Test plan
go test ./...passesgo test -race ./...passesJob.InitContainers,Job.InstanceID, andMount.Nameround-trip correctly throughJob.WithFieldsmemoryUsageBytesappears in metrics JSON output with a non-zero valuestatusCodeis omitted from stream responses when empty, present when set