From 6599f8ad8416ded2ea1e6935e13cdb0ba10fea7d Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Fri, 12 Dec 2025 14:35:44 +0100 Subject: [PATCH] add 'configured' event at the end of model configuration phase Currently when using models, the final message is 'confugiring' which could let users think the DMR configuration is still pending Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> # Conflicts: # pkg/api/event.go --- pkg/api/event.go | 2 ++ pkg/compose/model.go | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/api/event.go b/pkg/api/event.go index 92f2b3144..7ccb11382 100644 --- a/pkg/api/event.go +++ b/pkg/api/event.go @@ -67,6 +67,8 @@ const ( StatusExported = "Exported" StatusDownloading = "Downloading" StatusDownloadComplete = "Download complete" + StatusConfiguring = "Configuring" + StatusConfigured = "Configured" ) // Resource represents status change and progress for a compose resource. diff --git a/pkg/compose/model.go b/pkg/compose/model.go index 19c65fbe8..8561bd68a 100644 --- a/pkg/compose/model.go +++ b/pkg/compose/model.go @@ -107,7 +107,7 @@ func (m *modelAPI) PullModel(ctx context.Context, model types.ModelConfig, quiet events.On(api.Resource{ ID: model.Name, Status: api.Working, - Text: "Pulling", + Text: api.StatusPulling, }) cmd := exec.CommandContext(ctx, m.path, "pull", model.Model) @@ -161,7 +161,7 @@ func (m *modelAPI) ConfigureModel(ctx context.Context, config types.ModelConfig, events.On(api.Resource{ ID: config.Name, Status: api.Working, - Text: "Configuring", + Text: api.StatusConfiguring, }) // configure [--context-size=] MODEL args := []string{"configure"} @@ -174,7 +174,17 @@ func (m *modelAPI) ConfigureModel(ctx context.Context, config types.ModelConfig, if err != nil { return err } - return cmd.Run() + err = cmd.Run() + if err != nil { + events.On(errorEvent(config.Name, err.Error())) + return err + } + events.On(api.Resource{ + ID: config.Name, + Status: api.Done, + Text: api.StatusConfigured, + }) + return nil } func (m *modelAPI) SetModelVariables(ctx context.Context, project *types.Project) error {