feat(go): implement reflection API v2 over WebSocket#5150
Open
feat(go): implement reflection API v2 over WebSocket#5150
Conversation
…t this and allow additional object properties, and ensure key is set during action listing.
…metadata within an 'actions' field.
…-reflection-v2
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the Genkit Reflection Protocol V2, transitioning from an HTTP polling model to a bidirectional WebSocket-based communication system between the Genkit CLI and runtimes. The changes include a new protocol specification, a refactored abstract BaseRuntimeManager architecture in the CLI tools, and new client implementations in both Go and JavaScript. Additionally, the tools server has been updated to support bidirectional streaming and input streaming for bidirectional actions. I have no feedback to provide.
# Conflicts: # docs/reflection-v2-protocol.md # genkit-tools/cli/src/commands/start.ts # genkit-tools/cli/src/utils/manager-utils.ts # genkit-tools/common/src/manager/manager-v2.ts # genkit-tools/common/src/types/reflection.ts # genkit-tools/common/tests/manager-v2_test.ts # genkit-tools/genkit-schema.json # go/ai/gen.go # go/internal/cmd/jsonschemagen/jsonschemagen.go # js/core/src/reflection-types.ts # js/core/src/reflection-v2.ts # js/core/tests/reflection-v2_test.ts # js/pnpm-lock.yaml # py/packages/genkit/src/genkit/_core/_typing.py
pavelgj
approved these changes
Apr 17, 2026
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.
Implements the V2 Reflection API in Genkit Go, matching the JS implementation in
js/core/src/reflection-v2.ts. Where V1 is a polling HTTP server running inside the runtime, V2 is a WebSocket client: the CLI manager runs the server and runtimes connect to it and handle JSON-RPC 2.0 requests.Activated when
GENKIT_REFLECTION_V2_SERVERis set to the manager's WebSocket URL; otherwisegenkit.Initfalls back to V1.Protocol methods implemented
registerconfigurelistActionsactionsmap.listValuesrunActionrunActionStatefor early trace-ID delivery, andstreamChunknotifications whenstream: true. Errors are mapped to a JS-compatibleStatusshape with{code, message, details: {traceId, stack}}.cancelActionsendInputStreamChunk/endInputStream