feat: support status for ModelConfig - #2623
Conversation
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
fb541b3 to
6b41882
Compare
| } | ||
|
|
||
| type ModelConfigTranslation struct { | ||
| Model adk.Model |
There was a problem hiding this comment.
All harnesses should consume a validated and resolved ModelConfig, but this shared type is kagent-specific because it embeds adk.Model, and collectionReader constructs it with kagenttranslator.NewModelCompiler. Could this instead be a harness-neutral resolved model containing validated config, resolved non-secret values, references, and provenance, leaving ADK, Codex, and Claude rendering to their adapters?
| statuses, _ := krt.NewStatusCollection(modelConfigs, func(ctx krt.HandlerContext, modelConfig *kagentv1alpha3.ModelConfig) (*kagentv1alpha3.ModelConfigStatus, *ModelConfigReconciliation) { | ||
| state := &ModelConfigReconciliation{ModelConfigName: krt.Named{Namespace: modelConfig.Namespace, Name: modelConfig.Name}} | ||
| reader := collectionReader{ctx: ctx, configMaps: configMaps, secrets: secrets, modelConfigs: modelConfigs} | ||
| translation, translationErr := kagenttranslator.NewModelCompiler(reader).TranslateModel(context.Background(), modelConfig) |
There was a problem hiding this comment.
Could we make this shared resolution return typed semantic-vs-reference failures and validate the effective provider references? Right now TranslateModel dereferences SAP/Bedrock Secrets and Foundry ConfigMaps, so missing references also set Accepted=False, while addSecret misses the TLS caCertSecretKey, SAP client_id/client_secret, and Bedrock fixed credential keys. That can make the two conditions inconsistent or report ResolvedRefs=True for unusable credentials.
2 conditions
Accepted - for translation error
ResolvedRefs - for reference issues (i.e. model config referencing a secret)