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" \t qwen .cmd" , L" qwen " );
131+ Check (L" helper " , L" helper " );
132+ Check (L" helper .cmd --acp" , L" helper " );
133+ Check (L" \t helper .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