test(cmd): the upload chat switcher never offers a cloud model (red; adversarial review F1)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"git.d-ma.be/mathias/tapir/internal/config"
|
||||
)
|
||||
|
||||
// The chat over an uploaded recording sends the whole private transcript to the model
|
||||
// the user picks, so the switcher for it may offer local models only (ADR-035 review).
|
||||
|
||||
func TestUploadChatModels_NeverOffersACloudModelButKeepsTheLocalOrder(t *testing.T) {
|
||||
var cfg config.Config
|
||||
cfg.SummarizerModel = "koala/phi4-mini"
|
||||
cfg.FallbackModel = "iguana/gemma4-26b"
|
||||
cfg.CloudFallbackModel = "berget/mistral-small"
|
||||
|
||||
got := uploadChatModels(cfg)
|
||||
|
||||
want := []string{"koala/phi4-mini", "iguana/gemma4-26b"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Errorf("uploadChatModels = %v, want %v: the cloud model that the video chat offers must not be offered for a private recording", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUploadChatModels_ACloudPrimaryIsDroppedToo(t *testing.T) {
|
||||
var cfg config.Config
|
||||
cfg.SummarizerModel = "berget/mistral-small"
|
||||
cfg.FallbackModel = "iguana/gemma4-26b"
|
||||
|
||||
got := uploadChatModels(cfg)
|
||||
|
||||
if !reflect.DeepEqual(got, []string{"iguana/gemma4-26b"}) {
|
||||
t.Errorf("uploadChatModels = %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUploadChatModels_NoLocalModelMeansNoneOfferedNotACloudDefault(t *testing.T) {
|
||||
var cfg config.Config
|
||||
cfg.SummarizerModel = "berget/mistral-small"
|
||||
|
||||
if got := uploadChatModels(cfg); len(got) != 0 {
|
||||
t.Errorf("uploadChatModels = %v, want none", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user