Skip to content

Commit 726eb4d

Browse files
committed
fix: update X-Gateway-Model-Name header to targetModel after resolution
When the ExternalModel CR name differs from targetModel, the body-field-to-header plugin sets X-Gateway-Model-Name to the CR name but the HTTPRoute rule matches on targetModel. The model-provider-resolver now updates the header to targetModel after resolution, ensuring Envoy route matching succeeds.
1 parent 1c21104 commit 726eb4d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkg/plugins/model-provider-resolver/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func (p *ModelProviderResolverPlugin) ProcessRequest(ctx context.Context, cycleS
183183
// Drive Envoy routing to the selected provider's backend.
184184
request.SetHeader(SelectedProviderHeader, ref.providerName)
185185
request.SetHeader("Host", ref.endpoint)
186+
request.SetHeader("X-Gateway-Model-Name", ref.targetModel)
186187

187188
if model != ref.targetModel {
188189
request.SetBodyField("model", ref.targetModel)

0 commit comments

Comments
 (0)