STET

agent_patch

runs/2026-02-28__13-38-10__gpt-5-3-codex/flux-pr-1268/flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/agent-logs/agent.patch

22552 bytes

Back to adjudication
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go b/app/v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go
index 316e2fc..e3e028f 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go
+++ b/app/v2/pkg/engine/datasource/graphql_datasource/graphql_datasource.go
@@ -269,14 +269,6 @@ func (p *Planner[T]) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias
 	return "", false
 }
 
-func (p *Planner[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
-	return plan.DataSourcePlanningBehavior{
-		MergeAliasedRootNodes:      true,
-		OverrideFieldPathFromAlias: true,
-		IncludeTypeNameFields:      true,
-	}
-}
-
 func (p *Planner[T]) Register(visitor *plan.Visitor, configuration plan.DataSourceConfiguration[T], dataSourcePlannerConfiguration plan.DataSourcePlannerConfiguration) error {
 
 	p.visitor = visitor
@@ -1726,6 +1718,16 @@ type Factory[T Configuration] struct {
 	grpcClient         grpc.ClientConnInterface
 	grpcClientProvider func() grpc.ClientConnInterface
 	subscriptionClient GraphQLSubscriptionClient
+	planningBehavior   plan.DataSourcePlanningBehavior
+}
+
+func defaultPlanningBehavior(alwaysRewriteAbstractSelectionSet bool) plan.DataSourcePlanningBehavior {
+	return plan.DataSourcePlanningBehavior{
+		MergeAliasedRootNodes:                       true,
+		OverrideFieldPathFromAlias:                  true,
+		IncludeTypenameFields:                       true,
+		AlwaysRewriteDataSourceAbstractSelectionSet: alwaysRewriteAbstractSelectionSet,
+	}
 }
 
 // NewFactory (HTTP) creates a new factory for the GraphQL datasource planner
@@ -1746,6 +1748,7 @@ func NewFactory(executionContext context.Context, httpClient *http.Client, subsc
 		executionContext:   executionContext,
 		httpClient:         httpClient,
 		subscriptionClient: subscriptionClient,
+		planningBehavior:   defaultPlanningBehavior(false),
 	}, nil
 }
 
@@ -1764,6 +1767,7 @@ func NewFactoryGRPC(executionContext context.Context, grpcClient grpc.ClientConn
 	return &Factory[Configuration]{
 		executionContext: executionContext,
 		grpcClient:       grpcClient,
+		planningBehavior: defaultPlanningBehavior(true),
 	}, nil
 }
 
@@ -1784,6 +1788,7 @@ func NewFactoryGRPCClientProvider(executionContext context.Context, clientProvid
 	return &Factory[Configuration]{
 		executionContext:   executionContext,
 		grpcClientProvider: clientProvider,
+		planningBehavior:   defaultPlanningBehavior(true),
 	}, nil
 }
 
@@ -1825,6 +1830,15 @@ func (f *Factory[T]) UpstreamSchema(dataSourceConfig plan.DataSourceConfiguratio
 	return schema, true
 }
 
+func (f *Factory[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
+	if f.planningBehavior == (plan.DataSourcePlanningBehavior{}) {
+		// Keep backwards-compatible defaults for tests/users constructing Factory directly.
+		return defaultPlanningBehavior(false)
+	}
+
+	return f.planningBehavior
+}
+
 type Source struct {
 	httpClient *http.Client
 }
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/introspection_datasource/factory.go b/app/v2/pkg/engine/datasource/introspection_datasource/factory.go
index a251521..1f6c1d6 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/introspection_datasource/factory.go
+++ b/app/v2/pkg/engine/datasource/introspection_datasource/factory.go
@@ -29,3 +29,11 @@ func (f *Factory[T]) Context() context.Context {
 func (f *Factory[T]) UpstreamSchema(dataSourceConfig plan.DataSourceConfiguration[T]) (*ast.Document, bool) {
 	return nil, false
 }
+
+func (f *Factory[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
+	return plan.DataSourcePlanningBehavior{
+		MergeAliasedRootNodes:      false,
+		OverrideFieldPathFromAlias: true,
+		IncludeTypenameFields:      true,
+	}
+}
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/introspection_datasource/planner.go b/app/v2/pkg/engine/datasource/introspection_datasource/planner.go
index 2b05800..481dc3c 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/introspection_datasource/planner.go
+++ b/app/v2/pkg/engine/datasource/introspection_datasource/planner.go
@@ -45,14 +45,6 @@ func (p *Planner[T]) DownstreamResponseFieldAlias(_ int) (alias string, exists b
 	return
 }
 
-func (p *Planner[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
-	return plan.DataSourcePlanningBehavior{
-		MergeAliasedRootNodes:      false,
-		OverrideFieldPathFromAlias: true,
-		IncludeTypeNameFields:      true,
-	}
-}
-
 func (p *Planner[T]) EnterField(ref int) {
 	fieldName := p.v.Operation.FieldNameString(ref)
 	fieldAliasOrName := p.v.Operation.FieldAliasOrNameString(ref)
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/pubsub_datasource/pubsub_datasource.go b/app/v2/pkg/engine/datasource/pubsub_datasource/pubsub_datasource.go
index 60faa27..37c4304 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/pubsub_datasource/pubsub_datasource.go
+++ b/app/v2/pkg/engine/datasource/pubsub_datasource/pubsub_datasource.go
@@ -275,14 +275,6 @@ func (p *Planner[T]) ConfigureSubscription() plan.SubscriptionConfiguration {
 	return plan.SubscriptionConfiguration{}
 }
 
-func (p *Planner[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
-	return plan.DataSourcePlanningBehavior{
-		MergeAliasedRootNodes:      false,
-		OverrideFieldPathFromAlias: false,
-		IncludeTypeNameFields:      true,
-	}
-}
-
 func (p *Planner[T]) DownstreamResponseFieldAlias(_ int) (alias string, exists bool) {
 	return "", false
 }
@@ -316,6 +308,14 @@ func (f *Factory[T]) UpstreamSchema(dataSourceConfig plan.DataSourceConfiguratio
 	return nil, false
 }
 
+func (f *Factory[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
+	return plan.DataSourcePlanningBehavior{
+		MergeAliasedRootNodes:      false,
+		OverrideFieldPathFromAlias: false,
+		IncludeTypenameFields:      true,
+	}
+}
+
 func buildEventDataBytes(ref int, visitor *plan.Visitor, variables *resolve.Variables) ([]byte, error) {
 	// Collect the field arguments for fetch based operations
 	fieldArgs := visitor.Operation.FieldArguments(ref)
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/staticdatasource/static_datasource.go b/app/v2/pkg/engine/datasource/staticdatasource/static_datasource.go
index 3449afb..5c3e00f 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/datasource/staticdatasource/static_datasource.go
+++ b/app/v2/pkg/engine/datasource/staticdatasource/static_datasource.go
@@ -30,6 +30,13 @@ func (f *Factory[T]) UpstreamSchema(dataSourceConfig plan.DataSourceConfiguratio
 	return nil, false
 }
 
+func (f *Factory[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
+	return plan.DataSourcePlanningBehavior{
+		MergeAliasedRootNodes:      false,
+		OverrideFieldPathFromAlias: false,
+	}
+}
+
 type Planner[T Configuration] struct {
 	id     int
 	config Configuration
@@ -48,13 +55,6 @@ func (p *Planner[T]) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias
 	return
 }
 
-func (p *Planner[T]) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior {
-	return plan.DataSourcePlanningBehavior{
-		MergeAliasedRootNodes:      false,
-		OverrideFieldPathFromAlias: false,
-	}
-}
-
 func (p *Planner[T]) Register(_ *plan.Visitor, configuration plan.DataSourceConfiguration[T], _ plan.DataSourcePlannerConfiguration) error {
 	p.config = Configuration(configuration.CustomConfiguration())
 	return nil
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter.go b/app/v2/pkg/engine/plan/abstract_selection_rewriter.go
index 284ad42..8b1bd1d 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter.go
+++ b/app/v2/pkg/engine/plan/abstract_selection_rewriter.go
@@ -63,6 +63,7 @@ type fieldSelectionRewriter struct {
 
 	upstreamDefinition *ast.Document
 	dsConfiguration    DataSource
+	alwaysRewrite      bool
 
 	skipFieldRefs []int
 }
@@ -74,21 +75,22 @@ type RewriteResult struct {
 
 var resultNotRewritten = RewriteResult{}
 
-func newFieldSelectionRewriter(operation *ast.Document, definition *ast.Document) *fieldSelectionRewriter {
+func newFieldSelectionRewriter(
+	operation *ast.Document,
+	definition *ast.Document,
+	upstreamDefinition *ast.Document,
+	dsConfiguration DataSource,
+	alwaysRewrite bool,
+) *fieldSelectionRewriter {
 	return &fieldSelectionRewriter{
-		operation:  operation,
-		definition: definition,
+		operation:          operation,
+		definition:         definition,
+		upstreamDefinition: upstreamDefinition,
+		dsConfiguration:    dsConfiguration,
+		alwaysRewrite:      alwaysRewrite,
 	}
 }
 
-func (r *fieldSelectionRewriter) SetUpstreamDefinition(upstreamDefinition *ast.Document) {
-	r.upstreamDefinition = upstreamDefinition
-}
-
-func (r *fieldSelectionRewriter) SetDatasourceConfiguration(dsConfiguration DataSource) {
-	r.dsConfiguration = dsConfiguration
-}
-
 func (r *fieldSelectionRewriter) RewriteFieldSelection(fieldRef int, enclosingNode ast.Node) (res RewriteResult, err error) {
 	fieldName := r.operation.FieldNameBytes(fieldRef)
 	fieldTypeNode, ok := r.definition.FieldTypeNode(fieldName, enclosingNode)
@@ -143,6 +145,9 @@ func (r *fieldSelectionRewriter) processUnionSelection(fieldRef int, unionDefRef
 	}
 
 	needRewrite := r.unionFieldSelectionNeedsRewrite(selectionSetInfo, unionTypeNames, entityNames)
+	if !needRewrite && r.alwaysRewrite && selectionSetInfo.hasAnyInlineFragments() {
+		needRewrite = true
+	}
 	if !needRewrite {
 		return resultNotRewritten, nil
 	}
@@ -307,6 +312,9 @@ func (r *fieldSelectionRewriter) processObjectSelection(fieldRef int, objectDefR
 	}
 
 	needRewrite := r.objectFieldSelectionNeedsRewrite(selectionSetInfo, fieldTypeNameStr)
+	if !needRewrite && r.alwaysRewrite && selectionSetInfo.hasAnyInlineFragments() {
+		needRewrite = true
+	}
 	if !needRewrite {
 		return resultNotRewritten, nil
 	}
@@ -386,6 +394,9 @@ func (r *fieldSelectionRewriter) processInterfaceSelection(fieldRef int, interfa
 	selectionSetInfo.isInterfaceObject = isInterfaceObject
 
 	needRewrite := r.interfaceFieldSelectionNeedsRewrite(selectionSetInfo, interfaceTypeNames, entityNames)
+	if !needRewrite && r.alwaysRewrite && selectionSetInfo.hasAnyInlineFragments() {
+		needRewrite = true
+	}
 	if !needRewrite {
 		return resultNotRewritten, nil
 	}
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter_info.go b/app/v2/pkg/engine/plan/abstract_selection_rewriter_info.go
index 950ccb0..2fe61b1 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter_info.go
+++ b/app/v2/pkg/engine/plan/abstract_selection_rewriter_info.go
@@ -20,6 +20,10 @@ type selectionSetInfo struct {
 	hasInlineFragmentsOnUnions     bool
 }
 
+func (s selectionSetInfo) hasAnyInlineFragments() bool {
+	return s.hasInlineFragmentsOnObjects || s.hasInlineFragmentsOnInterfaces || s.hasInlineFragmentsOnUnions
+}
+
 type fieldSelection struct {
 	fieldSelectionRef int
 	fieldName         string
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter_test.go b/app/v2/pkg/engine/plan/abstract_selection_rewriter_test.go
index 11b5fc8..963738b 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/abstract_selection_rewriter_test.go
+++ b/app/v2/pkg/engine/plan/abstract_selection_rewriter_test.go
@@ -49,9 +49,13 @@ func TestInterfaceSelectionRewriter_RewriteOperation(t *testing.T) {
 
 		node, _ := def.Index.FirstNodeByNameStr(testCase.enclosingTypeName)
 
-		rewriter := newFieldSelectionRewriter(&op, &def)
-		rewriter.SetUpstreamDefinition(&upstreamDef)
-		rewriter.SetDatasourceConfiguration(testCase.dsConfiguration)
+		rewriter := newFieldSelectionRewriter(
+			&op,
+			&def,
+			&upstreamDef,
+			testCase.dsConfiguration,
+			false,
+		)
 
 		result, err := rewriter.RewriteFieldSelection(fieldRef, node)
 		require.NoError(t, err)
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/datasource_configuration.go b/app/v2/pkg/engine/plan/datasource_configuration.go
index 07ec63e..28db6fd 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/datasource_configuration.go
+++ b/app/v2/pkg/engine/plan/datasource_configuration.go
@@ -20,6 +20,8 @@ type DSHash uint64
 type PlannerFactory[DataSourceSpecificConfiguration any] interface {
 	// Planner creates a new DataSourcePlanner
 	Planner(logger abstractlogger.Logger) DataSourcePlanner[DataSourceSpecificConfiguration]
+	// DataSourcePlanningBehavior returns static planning behavior for this datasource factory.
+	DataSourcePlanningBehavior() DataSourcePlanningBehavior
 	// Context returns the execution context of the factory
 	// For stateful datasources, the factory should contain cancellable global execution context
 	// This method serves as a flag that factory should have a context
@@ -210,7 +212,8 @@ type dataSourceConfiguration[T any] struct {
 	id                  string            // id is a unique identifier for the DataSource
 	name                string            // name is a human-readable name for the DataSource
 	factory             PlannerFactory[T] // factory is the factory for the creation of the concrete DataSourcePlanner
-	custom              T                 // custom is the datasource specific configuration
+	planningBehavior    DataSourcePlanningBehavior
+	custom              T // custom is the datasource specific configuration
 
 	hash DSHash // hash is a unique hash for the dataSourceConfiguration used to match datasources
 }
@@ -235,6 +238,7 @@ func NewDataSourceConfigurationWithName[T any](id string, name string, factory P
 		id:                 id,
 		name:               name,
 		factory:            factory,
+		planningBehavior:   factory.DataSourcePlanningBehavior(),
 		custom:             customConfig,
 		hash:               DSHash(xxhash.Sum64([]byte(id))),
 	}, nil
@@ -254,6 +258,7 @@ type DataSource interface {
 	NodesInfo
 	DirectivesConfigurations
 	DataSourceUpstreamSchema
+	DataSourcePlanningBehaviorProvider
 	Id() string
 	Name() string
 	Hash() DSHash
@@ -299,6 +304,10 @@ func (d *dataSourceConfiguration[T]) FederationConfiguration() FederationMetaDat
 	return d.FederationMetaData
 }
 
+func (d *dataSourceConfiguration[T]) DataSourcePlanningBehavior() DataSourcePlanningBehavior {
+	return d.planningBehavior
+}
+
 func (d *dataSourceConfiguration[T]) Hash() DSHash {
 	return d.hash
 }
@@ -383,8 +392,11 @@ type DataSourcePlanningBehavior struct {
 	// When true expected response will be { "rootField": ..., "alias": ... }
 	// When false expected response will be { "rootField": ..., "original": ... }
 	OverrideFieldPathFromAlias bool
-	// IncludeTypeNameFields should be set to true if the planner allows to plan __typename fields
-	IncludeTypeNameFields bool
+	// IncludeTypenameFields should be set to true if the planner allows planning __typename fields.
+	IncludeTypenameFields bool
+	// AlwaysRewriteDataSourceAbstractSelectionSet tells the planner to flatten inline fragments for abstract/object
+	// selections even when they would otherwise be considered valid without rewrite.
+	AlwaysRewriteDataSourceAbstractSelectionSet bool
 }
 
 type DataSourceFetchPlanner interface {
@@ -392,8 +404,12 @@ type DataSourceFetchPlanner interface {
 	ConfigureSubscription() SubscriptionConfiguration
 }
 
-type DataSourceBehavior interface {
+type DataSourcePlanningBehaviorProvider interface {
 	DataSourcePlanningBehavior() DataSourcePlanningBehavior
+}
+
+type DataSourceBehavior interface {
+	DataSourcePlanningBehaviorProvider
 	// DownstreamResponseFieldAlias allows the DataSourcePlanner to overwrite the response path with an alias
 	// It's required to set OverrideFieldPathFromAlias to true
 	// This function is useful in the following scenario
@@ -424,11 +440,15 @@ type Identifyable interface {
 
 type DataSourcePlanner[T any] interface {
 	DataSourceFetchPlanner
-	DataSourceBehavior
+	DataSourcePlannerPathAliasProvider
 	Identifyable
 	Register(visitor *Visitor, configuration DataSourceConfiguration[T], dataSourcePlannerConfiguration DataSourcePlannerConfiguration) error
 }
 
+type DataSourcePlannerPathAliasProvider interface {
+	DownstreamResponseFieldAlias(downstreamFieldRef int) (alias string, exists bool)
+}
+
 type SubscriptionConfiguration struct {
 	Input          string
 	Variables      resolve.Variables
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/datasource_filter_visitor_test.go b/app/v2/pkg/engine/plan/datasource_filter_visitor_test.go
index acf02a9..831805f 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/datasource_filter_visitor_test.go
+++ b/app/v2/pkg/engine/plan/datasource_filter_visitor_test.go
@@ -56,10 +56,12 @@ func (b *dsBuilder) AddChildNodeExternalFieldNames(typeName string, fieldNames .
 
 func (b *dsBuilder) Schema(schema string) *dsBuilder {
 	def := unsafeparser.ParseGraphqlDocumentString(schema)
-	b.ds.factory = &FakeFactory[any]{
+	factory := &FakeFactory[any]{
 		upstreamSchema: &def,
 		behavior:       b.behavior,
 	}
+	b.ds.factory = factory
+	b.ds.planningBehavior = factory.DataSourcePlanningBehavior()
 
 	return b
 }
@@ -93,6 +95,7 @@ func (b *dsBuilder) DS() DataSource {
 
 func (b *dsBuilder) WithBehavior(behavior DataSourcePlanningBehavior) *dsBuilder {
 	b.behavior = &behavior
+	b.ds.planningBehavior = behavior
 	return b
 }
 
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/node_selection_visitor.go b/app/v2/pkg/engine/plan/node_selection_visitor.go
index 95c4f01..761cac8 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/node_selection_visitor.go
+++ b/app/v2/pkg/engine/plan/node_selection_visitor.go
@@ -649,9 +649,13 @@ func (c *nodeSelectionVisitor) rewriteSelectionSetHavingAbstractFragments(fieldR
 		return
 	}
 
-	rewriter := newFieldSelectionRewriter(c.operation, c.definition)
-	rewriter.SetUpstreamDefinition(upstreamSchema)
-	rewriter.SetDatasourceConfiguration(ds)
+	rewriter := newFieldSelectionRewriter(
+		c.operation,
+		c.definition,
+		upstreamSchema,
+		ds,
+		ds.DataSourcePlanningBehavior().AlwaysRewriteDataSourceAbstractSelectionSet,
+	)
 
 	result, err := rewriter.RewriteFieldSelection(fieldRef, c.walker.EnclosingTypeDefinition)
 	if err != nil {
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/path_builder_visitor.go b/app/v2/pkg/engine/plan/path_builder_visitor.go
index bd4d6b2..a541525 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/path_builder_visitor.go
+++ b/app/v2/pkg/engine/plan/path_builder_visitor.go
@@ -1247,7 +1247,7 @@ func (c *pathBuilderVisitor) addPlannerPathForTypename(
 	if fieldName != typeNameField {
 		return false
 	}
-	if !planningBehaviour.IncludeTypeNameFields {
+	if !planningBehaviour.IncludeTypenameFields {
 		return false
 	}
 
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/planner_configuration.go b/app/v2/pkg/engine/plan/planner_configuration.go
index 69e23e8..0eca7b6 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/planner_configuration.go
+++ b/app/v2/pkg/engine/plan/planner_configuration.go
@@ -63,7 +63,7 @@ func (p *plannerConfiguration[T]) ObjectFetchConfiguration() *objectFetchConfigu
 }
 
 func (p *plannerConfiguration[T]) DataSourcePlanningBehavior() DataSourcePlanningBehavior {
-	return p.planner.DataSourcePlanningBehavior()
+	return p.dataSourceConfiguration.DataSourcePlanningBehavior()
 }
 
 func (p *plannerConfiguration[T]) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias string, exists bool) {
diff --git a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/planner_test.go b/app/v2/pkg/engine/plan/planner_test.go
index 0a498ad..4cf576c 100644
--- a/tmp/agent-patch-flux-pr-1268.1-of-1.2026-02-28__13-38-10__gpt-5-3-codex/app/v2/pkg/engine/plan/planner_test.go
+++ b/app/v2/pkg/engine/plan/planner_test.go
@@ -1006,7 +1006,6 @@ func (f *FakeFactory[T]) Planner(logger abstractlogger.Logger) DataSourcePlanner
 	return &FakePlanner[T]{
 		source:         source,
 		upstreamSchema: f.upstreamSchema,
-		behavior:       f.behavior,
 	}
 }
 
@@ -1014,11 +1013,21 @@ func (f *FakeFactory[T]) Context() context.Context {
 	return context.TODO()
 }
 
+func (f *FakeFactory[T]) DataSourcePlanningBehavior() DataSourcePlanningBehavior {
+	if f.behavior == nil {
+		return DataSourcePlanningBehavior{
+			MergeAliasedRootNodes:      false,
+			OverrideFieldPathFromAlias: false,
+		}
+	}
+
+	return *f.behavior
+}
+
 type FakePlanner[T any] struct {
 	id             int
 	source         *StatefulSource
 	upstreamSchema *ast.Document
-	behavior       *DataSourcePlanningBehavior
 }
 
 func (f *FakePlanner[T]) ID() int {
@@ -1050,17 +1059,6 @@ func (f *FakePlanner[T]) ConfigureSubscription() SubscriptionConfiguration {
 	return SubscriptionConfiguration{}
 }
 
-func (f *FakePlanner[T]) DataSourcePlanningBehavior() DataSourcePlanningBehavior {
-	if f.behavior == nil {
-		return DataSourcePlanningBehavior{
-			MergeAliasedRootNodes:      false,
-			OverrideFieldPathFromAlias: false,
-		}
-	}
-
-	return *f.behavior
-}
-
 func (f *FakePlanner[T]) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias string, exists bool) {
 	return
 }