知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
fix(windows): a custom AI service whose key fails is named by its address in the tray and notes window
wquguru933d596be41d
diff --git a/windows/src/Cicada.Core/Ling.cs b/windows/src/Cicada.Core/Ling.csindex ed0fc28..dd85c1d 100644--- a/windows/src/Cicada.Core/Ling.cs+++ b/windows/src/Cicada.Core/Ling.cs@@ -254,6 +254,9 @@ public sealed class LingClient/// What messages call the service ("这个服务" for a custom address) and its host.public string ServiceName => Config.Provider.Id == "custom" ? Strings.L("这个服务") : Config.Name;public string ServiceHost => Host(Config.Base);+ /// Who a status line names: a custom service by its address, which says more than 这个服务+ /// and reads right in "The … key doesn't work".+ public string ServiceLabel => Config.Provider.Id == "custom" && ServiceHost.Length > 0 ? ServiceHost : ServiceName;/// Where the hear model is asked (a custom service's own address for it, else the service's).public string HearHost => Host(Config.HearBase ?? Config.Base);static string Host(string? b) => b is not null && Uri.TryCreate(b, UriKind.Absolute, out var u) ? u.Host : "";diff --git a/windows/src/Cicada/AICheckView.cs b/windows/src/Cicada/AICheckView.csindex 6b8056f..3087526 100644--- a/windows/src/Cicada/AICheckView.cs+++ b/windows/src/Cicada/AICheckView.cs@@ -68,13 +68,13 @@ static class AICheckViewvar ling = app.Ling;// A hear model at its own address: the one it couldn't reach is that one.var host = check.Failure?.Step == AICheck.StepId.Hear ? ling.HearHost : ling.ServiceHost;- if (check.Message(ling.ServiceName, host, ling.Config.TextModel, ling.HearName) is { } why)+ if (check.Message(ling.ServiceLabel, host, ling.Config.TextModel, ling.HearName) is { } why){var t = Ui.Text(why, 13, check.Failure is null ? Palette.WarnIcon : Palette.Danger);t.Margin = new Thickness(0, 4, 0, 0);into.Children.Add(t);}- if (check.ProxyLine(ling.ServiceName, ling.ServiceHost) is { } proxy)+ if (check.ProxyLine(ling.ServiceLabel, ling.ServiceHost) is { } proxy)into.Children.Add(new Border { Background = Palette.Mica, CornerRadius = new CornerRadius(8), Padding = new Thickness(10, 7, 10, 7), Margin = new Thickness(0, 6, 0, 0), Child = Ui.Text(proxy, 13, Palette.Body) });var acts = Actions(app, check, changeKey, recheckInStep);if (acts.Count == 0) return;diff --git a/windows/src/Cicada/App.cs b/windows/src/Cicada/App.csindex b401613..3a7d351 100644--- a/windows/src/Cicada/App.cs+++ b/windows/src/Cicada/App.cs@@ -585,8 +585,8 @@ sealed class Controller}if (f?.Why == AICheck.Reason.Unreachable){- string Body(AICheck h) => (h.Message(Ling.ServiceName, Ling.ServiceHost, Ling.Config.TextModel, Ling.HearName) ?? "")- + (h.ProxyLine(Ling.ServiceName, Ling.ServiceHost) is { } proxy ? "\n" + proxy : "");+ string Body(AICheck h) => (h.Message(Ling.ServiceLabel, Ling.ServiceHost, Ling.Config.TextModel, Ling.HearName) ?? "")+ + (h.ProxyLine(Ling.ServiceLabel, Ling.ServiceHost) is { } proxy ? "\n" + proxy : "");await Task.Yield();// 重新检查并开始: the check already under way (or one that finished reachable while the// dialog was up), else a new one; reachable closes the dialog.@@ -1145,7 +1145,7 @@ sealed class Controller{var h = Ling.Health;if (!Ling.HasKey || !h.NeedsUser) return null;- var name = Ling.ServiceName;+ var name = Ling.ServiceLabel;if (h.Failure is not { } f) return h.BalanceLine(name) is { } low ? (low, L("用完后就听不了对方")) : null;var stopped = L("听对方暂时用不了");return f.Why switch@@ -1217,8 +1217,8 @@ sealed class Controller["notesBase"] = c.NotesApart ? c.ForNotes.Base : null, ["notesModel"] = c.NotesApart ? c.ForNotes.TextModel : null, ["notesOwnKey"] = Ling.NotesHasOwnKey,["state"] = Ling.KeyState.ToString(), ["hears"] = Ling.Hears, ["seconds"] = Ling.Seconds is { } s ? Math.Round(s, 1) : null,["check"] = Ling.Health.Summary,- ["problem"] = Ling.Health.Message(Ling.ServiceName, Ling.ServiceHost, Ling.Config.TextModel, Ling.HearName),- ["proxy"] = Ling.Health.ProxyLine(Ling.ServiceName, Ling.ServiceHost),+ ["problem"] = Ling.Health.Message(Ling.ServiceLabel, Ling.ServiceHost, Ling.Config.TextModel, Ling.HearName),+ ["proxy"] = Ling.Health.ProxyLine(Ling.ServiceLabel, Ling.ServiceHost),["tray"] = AIProblem()?.Title,["dot"] = Problem is not null ? "problem" : Listen.Listening ? "live" : Updates.Available is not null ? "update" : null,["blocking"] = Problem,diff --git a/windows/src/Cicada/MainWindow.cs b/windows/src/Cicada/MainWindow.csindex 22d0c92..a5db336 100644--- a/windows/src/Cicada/MainWindow.cs+++ b/windows/src/Cicada/MainWindow.cs@@ -254,7 +254,7 @@ sealed class MainWindow : Window// The key is in but the service turned it down (or can't be reached, or can't hear): the// reason, and the settings page that fixes it.var ling = app.Ling;- var broken = app.KeyStepFailed ? ling.Health.Message(ling.ServiceName, ling.ServiceHost, ling.Config.TextModel, ling.HearName) : null;+ var broken = app.KeyStepFailed ? ling.Health.Message(ling.ServiceLabel, ling.ServiceHost, ling.Config.TextModel, ling.HearName) : null;(string title, string detail, bool done)[] steps =[// A service whose check passed ticks it; another service is named (接上 ZenMux).diff --git a/windows/src/Cicada/NotesWindow.cs b/windows/src/Cicada/NotesWindow.csindex 9a11c3e..aaa7026 100644--- a/windows/src/Cicada/NotesWindow.cs+++ b/windows/src/Cicada/NotesWindow.cs@@ -365,8 +365,7 @@ sealed class NotesWindow : Windowreturn stack;}- /// Who the banners name: a custom service by its address, which says more than 这个服务.- string ServiceLabel() => app.Ling.Config.Provider.Id == "custom" && app.Ling.ServiceHost.Length > 0 ? app.Ling.ServiceHost : app.Ling.ServiceName;+ string ServiceLabel() => app.Ling.ServiceLabel;/// When the last line the notes cover was said (0: nothing covered yet).double NotesCoveredUntil()diff --git a/windows/src/Cicada/SettingsWindow.cs b/windows/src/Cicada/SettingsWindow.csindex 182182b..86b5b4b 100644--- a/windows/src/Cicada/SettingsWindow.cs+++ b/windows/src/Cicada/SettingsWindow.cs@@ -937,7 +937,7 @@ sealed partial class SettingsWindow : WindowCard(null, L("模型"), null, CustomField("hear", s.AiHearModels.GetValueOrDefault("custom", ""), L("例如 qwen3-omni"))),Card(null, L("地址"), null, CustomField("hearBase", s.AiCustomHearBase, L("跟上面一样"))),};- if (check.Failure is { Step: AICheck.StepId.Hear } && check.Message(ling.ServiceName, ling.HearHost, c.TextModel, ling.HearName) is { } why)+ if (check.Failure is { Step: AICheck.StepId.Hear } && check.Message(ling.ServiceLabel, ling.HearHost, c.TextModel, ling.HearName) is { } why)parts.Add(Line(why, Palette.Danger));parts.Add(Card(null, "", null, SaveButton()));return new StackPanel { Children = { header, Body([.. parts]) } };