Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces ReflectionServerV2, which enables the Genkit runtime to act as a WebSocket client for dev tools integration using JSON-RPC 2.0. The Genkit class is updated to conditionally start this server based on the GENKIT_REFLECTION_V2_SERVER environment variable. Feedback identifies a critical bug in handleCancelAction where all active actions are interrupted instead of the specific one requested, and points out an unused stream variable in handleRunAction.
| public ReflectionServerV2(Registry registry, String serverUrl) { | ||
| this.registry = registry; | ||
| this.serverUrl = serverUrl; | ||
| this.runtimeId = ProcessHandle.current().pid() + ""; |
There was a problem hiding this comment.
Id needs to be globally unique, especially when multiple Genkit instances are involved.
Generally the logic is that runtime consists of: $prefix$suffix
Prefix is chosen based in the order:
- genkit instance name
- pid
Suffix: If it's the first genkit instance (based on singleton global counter), then empty suffix, otherwise it's _$instanceCount
Description
Support for Reflection V2 in Genkit Java
Type of Change
Documentation
Reviewer Notes