feat: establish unified administration and model context baseline
This commit is contained in:
@@ -174,7 +174,7 @@ func Run(request Request) error {
|
||||
|
||||
func reconcileCatalog(legacy legacyDescriptor, piModels piCatalog, settings piSettings, request Request) (config.ModelCatalog, error) {
|
||||
catalog := config.ModelCatalog{
|
||||
Defaults: config.ModelCatalogDefaults{Session: request.SessionDefault},
|
||||
Defaults: config.ModelCatalogDefaults{Interaction: request.SessionDefault},
|
||||
Embedding: config.ModelCatalogEmbedding{ID: request.EmbeddingID, Dimensions: request.EmbeddingDimensions},
|
||||
Providers: make(map[string]config.ModelProvider),
|
||||
}
|
||||
@@ -251,7 +251,9 @@ func reconcileCatalog(legacy legacyDescriptor, piModels piCatalog, settings piSe
|
||||
if !ok {
|
||||
return catalog, errors.New("metadataGeneration.default does not identify one legacy model")
|
||||
}
|
||||
catalog.Defaults.MetadataGeneration = mapped
|
||||
if mapped != request.SessionDefault {
|
||||
return catalog, errors.New("migration_required: legacy metadata default differs from the requested interaction model; align the legacy default explicitly before migration")
|
||||
}
|
||||
} else if legacy.MetadataGeneration.Default != "" {
|
||||
return catalog, errors.New("metadataGeneration.default is set without models")
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ func TestRunEmitsValidatedCandidateWithoutChangingLegacyInputs(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("candidate config.Load() error = %v", err)
|
||||
}
|
||||
if candidate.SchemaVersion != 2 || candidate.ModelCatalog.Defaults.Session != "zai/glm-5.3" {
|
||||
if candidate.SchemaVersion != 2 || candidate.ModelCatalog.Defaults.Interaction != "zai/glm-5.3" {
|
||||
t.Fatalf("candidate = %#v", candidate.ModelCatalog)
|
||||
}
|
||||
if got := candidate.ModelCatalog.Defaults.MetadataGeneration; got != "zai/glm-5.3" {
|
||||
if got := candidate.ModelCatalog.Defaults.Interaction; got != "zai/glm-5.3" {
|
||||
t.Fatalf("metadata default = %q", got)
|
||||
}
|
||||
if candidate.ModelCatalog.Providers["deepseek"].Session.Mode != "pi_builtin" {
|
||||
|
||||
Reference in New Issue
Block a user