Capture provider policy in backend execution targets

This commit is contained in:
2026-11-22 18:13:17 +00:00
parent 6056f93e55
commit adc700f96e
14 changed files with 69 additions and 9 deletions

View File

@@ -26,6 +26,8 @@ type ProfileResource struct {
// Its fields borrow immutable configuration captured by the adapter.
type BackendResource struct {
ID, Endpoint string
Provider *string
ZeroCost *bool
APIKeyEnv *string
ConcurrencyLimit, QueueCapacity *int
ExtraParams map[string]any
@@ -131,7 +133,7 @@ func (state *loaded) InspectBackend(ctx context.Context, id string) (*BackendRes
return nil, fmt.Errorf("%w: %q", backend.ErrBackendNotFound, id)
}
return &BackendResource{
ID: id, Endpoint: valueOrZero(config.Endpoint), APIKeyEnv: config.APIKeyEnv,
ID: id, Endpoint: valueOrZero(config.Endpoint), APIKeyEnv: config.APIKeyEnv, Provider: config.Provider, ZeroCost: config.ZeroCost,
ConcurrencyLimit: config.ConcurrencyLimit, QueueCapacity: config.QueueCapacity,
ExtraParams: config.ExtraParams, SmokeTests: captureBackend(id, config).SmokeTests,
}, nil