Skip to content

Conversation

Raezil
Copy link
Contributor

@Raezil Raezil commented Aug 19, 2025

Summary by cubic

Adds direct gNMI support for Get, Set, and Capabilities in the UTCP gRPC client. These methods now call gnmi.gNMI directly; all other tools still use UTCPService.CallTool.

  • New Features
    • Route gnmi.gNMI Capabilities, Get, and Set through dedicated helpers (bypasses UTCP CallTool).
    • Get args: paths ([]string), optional encoding (default JSON_IETF), optional use_models ("name@version").
    • Set args: update/replace/delete arrays; values accept GNMI TypedValue JSON or fall back to string.
    • Responses are returned as JSON objects (protojson -> map).

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

if ups, ok := args["update"].([]any); ok {
for _, u := range ups {
if m, ok := u.(map[string]any); ok {
p := parseGNMIPath(fmt.Sprint(m["path"]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing validation for update path; empty path may unintentionally target device root

Prompt for AI agents
Address the following comment on src/transports/grpc/grpc_transport.go at line 304:

<comment>Missing validation for update path; empty path may unintentionally target device root</comment>

<file context>
@@ -151,21 +169,203 @@ func (t *GRPCClientTransport) CallTool(ctx context.Context, toolName string, arg
 	defer conn.Close()
 
 	client := grpcpb.NewUTCPServiceClient(conn)
+
 	payload, err := json.Marshal(args)
 	if err != nil {
 		return nil, err
 	}
-	resp, err := client.CallTool(ctx, &amp;grpcpb.ToolCallRequest{Tool: toolName, ArgsJson: string(payload)})
</file context>

@Raezil Raezil merged commit 0753294 into main Aug 19, 2025
2 checks passed
@Raezil Raezil deleted the set-get-operations-grpc branch August 20, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant