fix(web): judge each alias of a reconciled endpoint, so an all-local transcript is not called cloud-served (#52)
The two-engine path writes '<base> + <alt>, reconciled by <model>'. IsLocalModel is a single-alias match, so the composite was 'not local' and the note claimed the audio left the homelab, naming a local host as the provider. Found by the PR #58 review. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+21
-3
@@ -273,12 +273,30 @@ func titleFromFilename(name string) string {
|
||||
// cloudProvider names the cloud service that produced a transcript, or false when it was
|
||||
// served locally (or by an unknown endpoint). "Local" is config.IsLocalModel: the same
|
||||
// definition the start-up validation uses, not a second string match here (#52).
|
||||
//
|
||||
// The endpoint is one alias, except for the two-engine path (ADR-034), which writes
|
||||
// "<base> + <alt>, reconciled by <model>". Every alias in it is judged on its own, so a
|
||||
// composite of local models is local and one naming a cloud alias names that provider.
|
||||
func cloudProvider(endpoint string) (string, bool) {
|
||||
if endpoint == "" || config.IsLocalModel(endpoint) {
|
||||
if strings.TrimSpace(endpoint) == "" {
|
||||
return "", false
|
||||
}
|
||||
provider, _, _ := strings.Cut(endpoint, "/")
|
||||
return provider, true
|
||||
aliases := []string{}
|
||||
for _, tok := range strings.Fields(endpoint) {
|
||||
if tok = strings.Trim(tok, ","); strings.Contains(tok, "/") {
|
||||
aliases = append(aliases, tok)
|
||||
}
|
||||
}
|
||||
if len(aliases) == 0 {
|
||||
aliases = append(aliases, strings.TrimSpace(endpoint))
|
||||
}
|
||||
for _, a := range aliases {
|
||||
if !config.IsLocalModel(a) {
|
||||
provider, _, _ := strings.Cut(a, "/")
|
||||
return provider, true
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
// hasNote reports whether any phase carries a note. A note is the only warning for a
|
||||
|
||||
Reference in New Issue
Block a user