STET

agent_patch

runs/2026-02-28__13-38-10__gpt-5-1-codex-mini/flux-pr-1262/flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/agent-logs/agent.patch

6753 bytes

Back to adjudication
diff --git a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/configuration.go b/app/v2/pkg/engine/datasource/grpc_datasource/configuration.go
index 6ee1940..dc95b8b 100644
--- a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/configuration.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/configuration.go
@@ -17,7 +17,7 @@ type GRPCMapping struct {
 	// SubscriptionRPCs maps GraphQL subscription fields to the corresponding gRPC RPC configurations
 	SubscriptionRPCs RPCConfigMap
 	// EntityRPCs defines how GraphQL types are resolved as entities using specific RPCs
-	EntityRPCs map[string]EntityRPCConfig
+    EntityRPCs map[string][]EntityRPCConfig
 	// Fields defines the field mappings between GraphQL types and gRPC messages
 	Fields map[string]FieldMap
 	// EnumValues defines the enum values for each enum type
@@ -47,10 +47,10 @@ type RPCConfig struct {
 
 // EntityRPCConfig defines the configuration for entity lookups
 type EntityRPCConfig struct {
-	// Key is a list of field names that uniquely identify the entity
-	Key string
-	// RPCConfig is the embedded configuration for the RPC operation
-	RPCConfig
+    // Key is the fields selection string that uniquely identifies the entity (as defined in @key)
+    Key string
+    // RPCConfig defines the gRPC operation for this key
+    RPCConfig
 }
 
 type FieldMapData struct {
diff --git a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_federation_test.go b/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_federation_test.go
index 5756d9d..8310aca 100644
--- a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_federation_test.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_federation_test.go
@@ -21,13 +21,15 @@ func TestEntityLookup(t *testing.T) {
 			query: `query EntityLookup($representations: [_Any!]!) { _entities(representations: $representations) { ... on Product { __typename id name price } } }`,
 			mapping: &GRPCMapping{
 				Service: "Products",
-				EntityRPCs: map[string]EntityRPCConfig{
+				EntityRPCs: map[string][]EntityRPCConfig{
 					"Product": {
-						Key: "id",
-						RPCConfig: RPCConfig{
-							RPC:      "LookupProductById",
-							Request:  "LookupProductByIdRequest",
-							Response: "LookupProductByIdResponse",
+						{
+							Key: "id",
+							RPCConfig: RPCConfig{
+								RPC:      "LookupProductById",
+								Request:  "LookupProductByIdRequest",
+								Response: "LookupProductByIdResponse",
+							},
 						},
 					},
 				},
diff --git a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor.go b/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor.go
index edf2dd8..b1a5c7d 100644
--- a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor.go
@@ -651,7 +651,8 @@ func (r *rpcPlanVisitor) resolveEntityInformation(inlineFragmentRef int) {
 		keyFields = append(keyFields, key.fieldName)
 	}
 
-	if ei, exists := r.mapping.EntityRPCs[r.planInfo.entityInfo.name]; exists {
+	if configs, exists := r.mapping.EntityRPCs[r.planInfo.entityInfo.name]; exists && len(configs) > 0 {
+		ei := configs[0]
 		r.currentCall.Request.Name = ei.RPCConfig.Request
 		r.currentCall.Response.Name = ei.RPCConfig.Response
 		r.planInfo.methodName = ei.RPCConfig.RPC
diff --git a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/mapping_test_helper.go b/app/v2/pkg/engine/datasource/grpc_datasource/mapping_test_helper.go
index 146f371..1ace3cd 100644
--- a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/mapping_test_helper.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/mapping_test_helper.go
@@ -218,21 +218,25 @@ func testMapping() *GRPCMapping {
 			},
 		},
 		SubscriptionRPCs: RPCConfigMap{},
-		EntityRPCs: map[string]EntityRPCConfig{
+		EntityRPCs: map[string][]EntityRPCConfig{
 			"Product": {
-				Key: "id",
-				RPCConfig: RPCConfig{
-					RPC:      "LookupProductById",
-					Request:  "LookupProductByIdRequest",
-					Response: "LookupProductByIdResponse",
+				{
+					Key: "id",
+					RPCConfig: RPCConfig{
+						RPC:      "LookupProductById",
+						Request:  "LookupProductByIdRequest",
+						Response: "LookupProductByIdResponse",
+					},
 				},
 			},
 			"Storage": {
-				Key: "id",
-				RPCConfig: RPCConfig{
-					RPC:      "LookupStorageById",
-					Request:  "LookupStorageByIdRequest",
-					Response: "LookupStorageByIdResponse",
+				{
+					Key: "id",
+					RPCConfig: RPCConfig{
+						RPC:      "LookupStorageById",
+						Request:  "LookupStorageByIdRequest",
+						Response: "LookupStorageByIdResponse",
+					},
 				},
 			},
 		},
diff --git a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/grpctest/mapping/mapping.go b/app/v2/pkg/grpctest/mapping/mapping.go
index 842a029..1476d08 100644
--- a/tmp/agent-patch-flux-pr-1262.1-of-1.2026-02-28__18-00-08__gpt-5-1-codex-mini/app/v2/pkg/grpctest/mapping/mapping.go
+++ b/app/v2/pkg/grpctest/mapping/mapping.go
@@ -225,21 +225,25 @@ func DefaultGRPCMapping() *grpcdatasource.GRPCMapping {
 			},
 		},
 		SubscriptionRPCs: grpcdatasource.RPCConfigMap{},
-		EntityRPCs: map[string]grpcdatasource.EntityRPCConfig{
+		EntityRPCs: map[string][]grpcdatasource.EntityRPCConfig{
 			"Product": {
-				Key: "id",
-				RPCConfig: grpcdatasource.RPCConfig{
-					RPC:      "LookupProductById",
-					Request:  "LookupProductByIdRequest",
-					Response: "LookupProductByIdResponse",
+				{
+					Key: "id",
+					RPCConfig: grpcdatasource.RPCConfig{
+						RPC:      "LookupProductById",
+						Request:  "LookupProductByIdRequest",
+						Response: "LookupProductByIdResponse",
+					},
 				},
 			},
 			"Storage": {
-				Key: "id",
-				RPCConfig: grpcdatasource.RPCConfig{
-					RPC:      "LookupStorageById",
-					Request:  "LookupStorageByIdRequest",
-					Response: "LookupStorageByIdResponse",
+				{
+					Key: "id",
+					RPCConfig: grpcdatasource.RPCConfig{
+						RPC:      "LookupStorageById",
+						Request:  "LookupStorageByIdRequest",
+						Response: "LookupStorageByIdResponse",
+					},
 				},
 			},
 		},