Unify model changes and shell command argument handling

This commit is contained in:
Ian Gulliver
2026-10-20 22:53:47 -07:00
parent ba675f9a5a
commit a2de021f3c
6 changed files with 43 additions and 55 deletions
+3 -10
View File
@@ -147,16 +147,9 @@ func (m *Manager) MessageLead(ctx context.Context, user api.User, text, model, s
}
}
if model != "" && model != sess.Model {
err = checkModel(sess, model)
if err != nil {
return api.AgentSession{}, err
}
err = m.store.SetSessionModel(ctx, sess.Id, model, user.Login)
if err != nil {
return api.AgentSession{}, err
}
sess.Model = model
sess, err = m.changeModel(ctx, sess, model, user.Login)
if err != nil {
return api.AgentSession{}, err
}
err = m.store.AddLeadInput(ctx, store.LeadInput{Owner: user.Login, Kind: store.LeadMessage, Actor: user.Login, Text: text, Images: images, SendID: sendID})
if err != nil {