agent_patch
runs/2026-02-28__13-38-10__gpt-5-1-codex-mini/flux-pr-1209/flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/agent-logs/agent.patch
5721 bytes
diff --git a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/compiler.go b/app/v2/pkg/engine/datasource/grpc_datasource/compiler.go
index 1b519b7..db89719 100644
--- a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/compiler.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/compiler.go
@@ -322,8 +322,18 @@ func (p *RPCCompiler) Compile(executionPlan *RPCExecutionPlan, inputData gjson.R
invocations := make([]Invocation, 0, len(executionPlan.Calls))
for _, call := range executionPlan.Calls {
- inputMessage := p.doc.MessageByName(call.Request.Name)
- outputMessage := p.doc.MessageByName(call.Response.Name)
+ inputRef := p.doc.MessageRefByName(call.Request.Name)
+ if inputRef == -1 {
+ return nil, fmt.Errorf("request message %s referenced by method %s not found in schema", call.Request.Name, call.MethodName)
+ }
+
+ outputRef := p.doc.MessageRefByName(call.Response.Name)
+ if outputRef == -1 {
+ return nil, fmt.Errorf("response message %s referenced by method %s not found in schema", call.Response.Name, call.MethodName)
+ }
+
+ inputMessage := p.doc.Messages[inputRef]
+ outputMessage := p.doc.Messages[outputRef]
request := p.buildProtoMessage(inputMessage, &call.Request, inputData)
response := p.newEmptyMessage(outputMessage)
diff --git a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__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 f1ad122..7c377ad 100644
--- a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__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
@@ -335,6 +335,10 @@ func (r *rpcPlanVisitor) EnterField(ref int) {
Repeated: r.definition.TypeIsList(fdt),
}
+ if r.operation.FieldAliasIsDefined(ref) {
+ field.Alias = r.operation.FieldAliasString(ref)
+ }
+
if typeName == DataTypeEnum {
field.EnumName = r.definition.FieldDefinitionTypeNameString(fd)
}
diff --git a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/grpc_datasource.go b/app/v2/pkg/engine/datasource/grpc_datasource/grpc_datasource.go
index a87a266..723816d 100644
--- a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/engine/datasource/grpc_datasource/grpc_datasource.go
+++ b/app/v2/pkg/engine/datasource/grpc_datasource/grpc_datasource.go
@@ -161,15 +161,16 @@ func (d *DataSource) marshalResponseJSON(arena *astjson.Arena, message *RPCMessa
}
for _, field := range validFields {
+ responseName := responseFieldName(field)
if field.StaticValue != "" {
if len(message.MemberTypes) == 0 {
- root.Set(field.JSONPath, arena.NewString(field.StaticValue))
+ root.Set(responseName, arena.NewString(field.StaticValue))
continue
}
for _, memberTypes := range message.MemberTypes {
if memberTypes == string(data.Type().Descriptor().Name()) {
- root.Set(field.JSONPath, arena.NewString(memberTypes))
+ root.Set(responseName, arena.NewString(memberTypes))
break
}
}
@@ -185,12 +186,12 @@ func (d *DataSource) marshalResponseJSON(arena *astjson.Arena, message *RPCMessa
if fd.IsList() {
list := data.Get(fd).List()
if !list.IsValid() {
- root.Set(field.JSONPath, arena.NewNull())
+ root.Set(responseName, arena.NewNull())
continue
}
arr := arena.NewArray()
- root.Set(field.JSONPath, arr)
+ root.Set(responseName, arr)
for i := 0; i < list.Len(); i++ {
switch fd.Kind() {
@@ -214,7 +215,7 @@ func (d *DataSource) marshalResponseJSON(arena *astjson.Arena, message *RPCMessa
if fd.Kind() == protoref.MessageKind {
msg := data.Get(fd).Message()
if !msg.IsValid() {
- root.Set(field.JSONPath, arena.NewNull())
+ root.Set(responseName, arena.NewNull())
continue
}
@@ -229,18 +230,25 @@ func (d *DataSource) marshalResponseJSON(arena *astjson.Arena, message *RPCMessa
return nil, err
}
} else {
- root.Set(field.JSONPath, value)
+ root.Set(responseName, value)
}
continue
}
- d.setJSONValue(arena, root, field.JSONPath, data, fd)
+ d.setJSONValue(arena, root, responseName, data, fd)
}
return root, nil
}
+func responseFieldName(field RPCField) string {
+ if field.Alias != "" {
+ return field.Alias
+ }
+ return field.JSONPath
+}
+
func (d *DataSource) setJSONValue(arena *astjson.Arena, root *astjson.Value, name string, data protoref.Message, fd protoref.FieldDescriptor) {
if !data.IsValid() {
root.Set(name, arena.NewNull())
diff --git a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/grpctest/mapping/mapping.go b/app/v2/pkg/grpctest/mapping/mapping.go
index 9282fa5..85c2557 100644
--- a/tmp/agent-patch-flux-pr-1209.1-of-1.2026-02-28__13-38-10__gpt-5-1-codex-mini/app/v2/pkg/grpctest/mapping/mapping.go
+++ b/app/v2/pkg/grpctest/mapping/mapping.go
@@ -469,6 +469,25 @@ func DefaultGRPCMapping() *grpcdatasource.GRPCMapping {
TargetName: "payload",
},
},
+ "SearchResult": {
+ "product": {
+ TargetName: "product",
+ },
+ "user": {
+ TargetName: "user",
+ },
+ "category": {
+ TargetName: "category",
+ },
+ },
+ "ActionResult": {
+ "actionSuccess": {
+ TargetName: "action_success",
+ },
+ "actionError": {
+ TargetName: "action_error",
+ },
+ },
},
}
}