Skip to content

Commit 447cfaa

Browse files
test(spelling): use real word 'helper' as custom-agent placeholder
The earlier 'mybot' placeholder was still flagged by check-spelling because it is not a real English word. Replace remaining 'qwen' occurrences in CustomAgentIdTests.cpp (which were missed in 24cb0d8) and the 'mybot' occurrences in CustomAgentId.h, CustomAgentIdTests.cpp, and CustomAgentAndPolicyTests.cpp with the real word 'helper'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 32b4410 commit 447cfaa

3 files changed

Lines changed: 48 additions & 48 deletions

File tree

src/cascadia/UnitTests_SettingsModel/CustomAgentAndPolicyTests.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,18 @@ namespace SettingsModelUnitTests
132132
// The whole point of PR #123: a custom agent must survive load
133133
// with its "custom:" prefix intact. If this regresses, the
134134
// settings page reverts to the default agent on next load.
135-
const auto settings = MakeSettings(R"("acpAgent": "custom:mybot", "acpCustomCommand": "mybot.cmd --acp")");
135+
const auto settings = MakeSettings(R"("acpAgent": "custom:helper", "acpCustomCommand": "helper.cmd --acp")");
136136
const auto& globals = settings->GlobalSettings();
137-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, globals.AcpAgent());
138-
VERIFY_ARE_EQUAL(winrt::hstring{ L"mybot.cmd --acp" }, globals.AcpCustomCommand());
137+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, globals.AcpAgent());
138+
VERIFY_ARE_EQUAL(winrt::hstring{ L"helper.cmd --acp" }, globals.AcpCustomCommand());
139139
}
140140

141141
void CustomAgentAndPolicyTests::CustomDelegateAgentRoundtrips()
142142
{
143-
const auto settings = MakeSettings(R"("delegateAgent": "custom:mybot", "delegateCustomCommand": "mybot.cmd --acp")");
143+
const auto settings = MakeSettings(R"("delegateAgent": "custom:helper", "delegateCustomCommand": "helper.cmd --acp")");
144144
const auto& globals = settings->GlobalSettings();
145-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, globals.DelegateAgent());
146-
VERIFY_ARE_EQUAL(winrt::hstring{ L"mybot.cmd --acp" }, globals.DelegateCustomCommand());
145+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, globals.DelegateAgent());
146+
VERIFY_ARE_EQUAL(winrt::hstring{ L"helper.cmd --acp" }, globals.DelegateCustomCommand());
147147
}
148148

149149
void CustomAgentAndPolicyTests::QuotedPathCustomCommandRoundtrips()
@@ -152,10 +152,10 @@ namespace SettingsModelUnitTests
152152
// are common for users on the Windows installer paths. Make sure
153153
// the parser preserves them verbatim.
154154
const auto settings = MakeSettings(
155-
R"("acpAgent": "custom:mybot", "acpCustomCommand": "\"C:\\Program Files\\mybot\\mybot.cmd\" --acp")");
155+
R"("acpAgent": "custom:helper", "acpCustomCommand": "\"C:\\Program Files\\helper\\helper.cmd\" --acp")");
156156
const auto& globals = settings->GlobalSettings();
157-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, globals.AcpAgent());
158-
VERIFY_ARE_EQUAL(winrt::hstring{ LR"("C:\Program Files\mybot\mybot.cmd" --acp)" },
157+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, globals.AcpAgent());
158+
VERIFY_ARE_EQUAL(winrt::hstring{ LR"("C:\Program Files\helper\helper.cmd" --acp)" },
159159
globals.AcpCustomCommand());
160160
}
161161

@@ -216,14 +216,14 @@ namespace SettingsModelUnitTests
216216

217217
void CustomAgentAndPolicyTests::EffectiveAcpAgentCustomPassesWhenNoCustomPolicy()
218218
{
219-
const auto settings = MakeSettings(R"("acpAgent": "custom:mybot", "acpCustomCommand": "mybot.cmd")");
219+
const auto settings = MakeSettings(R"("acpAgent": "custom:helper", "acpCustomCommand": "helper.cmd")");
220220
SetPolicy(MakePolicy(/*allowedAgents*/ std::nullopt, AgentPolicy::PolicyState::NotConfigured));
221-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, settings->GlobalSettings().EffectiveAcpAgent());
221+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, settings->GlobalSettings().EffectiveAcpAgent());
222222
}
223223

224224
void CustomAgentAndPolicyTests::EffectiveAcpAgentCustomBlockedByCustomPolicy()
225225
{
226-
const auto settings = MakeSettings(R"("acpAgent": "custom:mybot", "acpCustomCommand": "mybot.cmd")");
226+
const auto settings = MakeSettings(R"("acpAgent": "custom:helper", "acpCustomCommand": "helper.cmd")");
227227
SetPolicy(MakePolicy(/*allowedAgents*/ std::nullopt, AgentPolicy::PolicyState::Blocked));
228228
VERIFY_ARE_EQUAL(winrt::hstring{}, settings->GlobalSettings().EffectiveAcpAgent());
229229
}
@@ -236,10 +236,10 @@ namespace SettingsModelUnitTests
236236
// Admin allowlist with only "gemini" — would block built-in
237237
// copilot. But a custom: agent passes through unchanged because
238238
// customAgents policy is NotConfigured / Allowed.
239-
const auto settings = MakeSettings(R"("acpAgent": "custom:mybot", "acpCustomCommand": "mybot.cmd")");
239+
const auto settings = MakeSettings(R"("acpAgent": "custom:helper", "acpCustomCommand": "helper.cmd")");
240240
SetPolicy(MakePolicy(std::set<std::wstring, AgentPolicy::CaseInsensitiveLess>{ L"gemini" },
241241
AgentPolicy::PolicyState::NotConfigured));
242-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, settings->GlobalSettings().EffectiveAcpAgent());
242+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, settings->GlobalSettings().EffectiveAcpAgent());
243243
}
244244

245245
// ── EffectiveDelegateAgent ──────────────────────────────────────────
@@ -267,17 +267,17 @@ namespace SettingsModelUnitTests
267267

268268
void CustomAgentAndPolicyTests::EffectiveDelegateAgentCustomBlockedByCustomPolicy()
269269
{
270-
const auto settings = MakeSettings(R"("delegateAgent": "custom:mybot", "delegateCustomCommand": "mybot.cmd")");
270+
const auto settings = MakeSettings(R"("delegateAgent": "custom:helper", "delegateCustomCommand": "helper.cmd")");
271271
SetPolicy(MakePolicy(/*allowedAgents*/ std::nullopt, AgentPolicy::PolicyState::Blocked));
272272
VERIFY_ARE_EQUAL(winrt::hstring{}, settings->GlobalSettings().EffectiveDelegateAgent());
273273
}
274274

275275
void CustomAgentAndPolicyTests::EffectiveDelegateAgentCustomIgnoresAllowedAgentsAllowlist()
276276
{
277-
const auto settings = MakeSettings(R"("delegateAgent": "custom:mybot", "delegateCustomCommand": "mybot.cmd")");
277+
const auto settings = MakeSettings(R"("delegateAgent": "custom:helper", "delegateCustomCommand": "helper.cmd")");
278278
SetPolicy(MakePolicy(std::set<std::wstring, AgentPolicy::CaseInsensitiveLess>{ L"gemini" },
279279
AgentPolicy::PolicyState::NotConfigured));
280-
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:mybot" }, settings->GlobalSettings().EffectiveDelegateAgent());
280+
VERIFY_ARE_EQUAL(winrt::hstring{ L"custom:helper" }, settings->GlobalSettings().EffectiveDelegateAgent());
281281
}
282282

283283
// ── Lock-state ──────────────────────────────────────────────────────

src/cascadia/inc/CustomAgentId.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// CustomAgentId.h — derive a short, stable identifier from a user-supplied
55
// command line for a "custom" AI agent (the ACP / delegate agent slot).
66
//
7-
// The settings UI lets the user paste an arbitrary command (e.g. `mybot.cmd
8-
// --acp`, `"C:\Program Files\mybot\mybot.cmd" --acp`, or just `mybot`).
7+
// The settings UI lets the user paste an arbitrary command (e.g. `helper.cmd
8+
// --acp`, `"C:\Program Files\helper\helper.cmd" --acp`, or just `helper`).
99
// The settings model stores this command verbatim in AcpCustomCommand /
1010
// DelegateCustomCommand. But the agent *id* itself (AcpAgent /
1111
// DelegateAgent) needs to be a single short token so that the rest of the

src/cascadia/ut_app/CustomAgentIdTests.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// Tests for `DeriveCustomAgentId` (src/cascadia/inc/CustomAgentId.h).
77
//
88
// This is the function used by the AI Agents settings page to turn a
9-
// user-supplied command line (e.g. `mybot.cmd --acp`, `"C:\Program
10-
// Files\mybot\mybot.cmd" --acp`) into the short token that becomes the
11-
// suffix of the stored agent id (e.g. `custom:mybot`). Every downstream
9+
// user-supplied command line (e.g. `helper.cmd --acp`, `"C:\Program
10+
// Files\helper\helper.cmd" --acp`) into the short token that becomes the
11+
// suffix of the stored agent id (e.g. `custom:helper`). Every downstream
1212
// consumer that keys on the prefixed id (EffectiveAcpAgent policy gate,
1313
// command-line resolver, custom-edit/delete UI gates) depends on this
1414
// derivation; regressing this function silently breaks the save/reload
@@ -66,77 +66,77 @@ namespace TerminalAppUnitTests
6666

6767
void CustomAgentIdTests::BareName()
6868
{
69-
Check(L"qwen", L"qwen");
69+
Check(L"helper", L"helper");
7070
}
7171

7272
void CustomAgentIdTests::NameWithExe()
7373
{
74-
Check(L"qwen.exe", L"qwen");
74+
Check(L"helper.exe", L"helper");
7575
}
7676

7777
void CustomAgentIdTests::NameWithCmd()
7878
{
79-
Check(L"qwen.cmd", L"qwen");
79+
Check(L"helper.cmd", L"helper");
8080
}
8181

8282
void CustomAgentIdTests::NameWithBat()
8383
{
84-
Check(L"qwen.bat", L"qwen");
84+
Check(L"helper.bat", L"helper");
8585
}
8686

8787
void CustomAgentIdTests::ExtensionStripIsCaseInsensitive()
8888
{
89-
Check(L"qwen.EXE", L"qwen");
90-
Check(L"qwen.Cmd", L"qwen");
91-
Check(L"qwen.BAT", L"qwen");
92-
Check(L"qwen.cMd --acp", L"qwen");
89+
Check(L"helper.EXE", L"helper");
90+
Check(L"helper.Cmd", L"helper");
91+
Check(L"helper.BAT", L"helper");
92+
Check(L"helper.cMd --acp", L"helper");
9393
}
9494

9595
void CustomAgentIdTests::NameWithArgs()
9696
{
97-
Check(L"qwen.cmd --acp", L"qwen");
98-
Check(L"qwen --acp --stdio", L"qwen");
97+
Check(L"helper.cmd --acp", L"helper");
98+
Check(L"helper --acp --stdio", L"helper");
9999
}
100100

101101
void CustomAgentIdTests::UnquotedPath()
102102
{
103-
Check(L"C:\\tools\\qwen.cmd", L"qwen");
104-
Check(L"C:\\tools\\qwen.cmd --acp", L"qwen");
103+
Check(L"C:\\tools\\helper.cmd", L"helper");
104+
Check(L"C:\\tools\\helper.cmd --acp", L"helper");
105105
Check(L"D:\\local-bin\\my-agent.exe", L"my-agent");
106106
}
107107

108108
void CustomAgentIdTests::QuotedPathWithSpaces()
109109
{
110110
// Full path containing spaces, properly quoted — the whole quoted
111111
// region is the executable.
112-
Check(L"\"C:\\Program Files\\qwen\\qwen.cmd\"", L"qwen");
112+
Check(L"\"C:\\Program Files\\helper\\helper.cmd\"", L"helper");
113113
}
114114

115115
void CustomAgentIdTests::QuotedPathWithSpacesAndArgs()
116116
{
117-
Check(L"\"C:\\Program Files\\qwen\\qwen.cmd\" --acp", L"qwen");
117+
Check(L"\"C:\\Program Files\\helper\\helper.cmd\" --acp", L"helper");
118118
Check(L"\"C:\\Program Files (x86)\\my agent\\my-agent.exe\" --stdio --acp",
119119
L"my-agent");
120120
}
121121

122122
void CustomAgentIdTests::ForwardSlashPath()
123123
{
124124
// POSIX-style forward slashes (some users paste paths like this).
125-
Check(L"/usr/bin/qwen", L"qwen");
126-
Check(L"C:/tools/qwen.cmd --acp", L"qwen");
125+
Check(L"/usr/bin/helper", L"helper");
126+
Check(L"C:/tools/helper.cmd --acp", L"helper");
127127
}
128128

129129
void CustomAgentIdTests::LeadingWhitespace()
130130
{
131-
Check(L" qwen", L"qwen");
132-
Check(L" qwen.cmd --acp", L"qwen");
133-
Check(L"\tqwen.cmd", L"qwen");
131+
Check(L" helper", L"helper");
132+
Check(L" helper.cmd --acp", L"helper");
133+
Check(L"\thelper.cmd", L"helper");
134134
}
135135

136136
void CustomAgentIdTests::TabSeparator()
137137
{
138138
// Tab between exe and args.
139-
Check(L"qwen.cmd\t--acp", L"qwen");
139+
Check(L"helper.cmd\t--acp", L"helper");
140140
}
141141

142142
void CustomAgentIdTests::Empty()
@@ -155,7 +155,7 @@ namespace TerminalAppUnitTests
155155
{
156156
// Missing closing quote — take everything after the opening quote.
157157
// Whatever the user typed is at least a recognizable token, not a crash.
158-
Check(L"\"C:\\Program Files\\qwen\\qwen.cmd", L"qwen");
158+
Check(L"\"C:\\Program Files\\helper\\helper.cmd", L"helper");
159159
}
160160

161161
void CustomAgentIdTests::QuoteOnlyIsEmpty()
@@ -192,8 +192,8 @@ namespace TerminalAppUnitTests
192192
{
193193
// The function strips at the *last* `\` or `/` (find_last_of), so
194194
// mixed paths are handled.
195-
Check(L"C:/foo\\bar/qwen.cmd", L"qwen");
196-
Check(L"C:\\foo/bar\\qwen.exe", L"qwen");
195+
Check(L"C:/foo\\bar/helper.cmd", L"helper");
196+
Check(L"C:\\foo/bar\\helper.exe", L"helper");
197197
}
198198

199199
void CustomAgentIdTests::NoExtensionStripWhenTokenEqualsExtension()
@@ -208,8 +208,8 @@ namespace TerminalAppUnitTests
208208
{
209209
// We only strip .exe / .cmd / .bat. Other extensions are part of
210210
// the id (e.g. PowerShell scripts).
211-
Check(L"qwen.ps1", L"qwen.ps1");
212-
Check(L"qwen.py", L"qwen.py");
213-
Check(L"qwen.sh", L"qwen.sh");
211+
Check(L"helper.ps1", L"helper.ps1");
212+
Check(L"helper.py", L"helper.py");
213+
Check(L"helper.sh", L"helper.sh");
214214
}
215215
}

0 commit comments

Comments
 (0)