88 pickWelcomeGuideAgent ,
99 pickWelcomeGuideAgentForRelay ,
1010 pickWelcomeTeamStarterAgentForRelay ,
11+ welcomeStarterRuntimeUpdate ,
1112 WELCOME_GUIDE_AGENT_NAME ,
1213 WELCOME_GUIDE_PERSONA_ID ,
1314 WELCOME_TEAM_ID ,
@@ -28,6 +29,7 @@ function makeAgent(overrides = {}) {
2829 relayUrl : RELAY_A ,
2930 acpCommand : "buzz-acp" ,
3031 agentCommand : "buzz-agent" ,
32+ agentCommandOverride : null ,
3133 agentArgs : [ ] ,
3234 mcpCommand : "buzz-dev-mcp" ,
3335 turnTimeoutSeconds : 120 ,
@@ -36,6 +38,7 @@ function makeAgent(overrides = {}) {
3638 parallelism : 1 ,
3739 systemPrompt : null ,
3840 model : null ,
41+ provider : null ,
3942 envVars : { } ,
4043 status : "stopped" ,
4144 pid : null ,
@@ -205,6 +208,87 @@ test("all Welcome starters use the onboarding runtime preference", async () => {
205208 }
206209} ) ;
207210
211+ test ( "existing Welcome starter rematerializes runtime-specific fields atomically" , ( ) => {
212+ const existing = makeAgent ( {
213+ pubkey : PUB_A ,
214+ personaId : WELCOME_GUIDE_PERSONA_ID ,
215+ agentCommand : "claude-agent-acp" ,
216+ agentCommandOverride : "claude-agent-acp" ,
217+ agentArgs : [ "--old" ] ,
218+ mcpCommand : "" ,
219+ model : "claude-sonnet" ,
220+ provider : "anthropic" ,
221+ } ) ;
222+
223+ assert . deepEqual (
224+ welcomeStarterRuntimeUpdate ( existing , {
225+ name : "Fizz" ,
226+ agentCommand : "codex-acp" ,
227+ agentArgs : [ "--new" ] ,
228+ mcpCommand : "buzz-dev-mcp" ,
229+ model : "gpt-5.6-sol" ,
230+ provider : null ,
231+ } ) ,
232+ {
233+ pubkey : PUB_A ,
234+ agentCommand : "codex-acp" ,
235+ harnessOverride : true ,
236+ agentArgs : [ "--new" ] ,
237+ mcpCommand : "buzz-dev-mcp" ,
238+ model : "gpt-5.6-sol" ,
239+ provider : null ,
240+ } ,
241+ ) ;
242+ } ) ;
243+
244+ test ( "existing Welcome starter clears stale model and provider for Claude" , ( ) => {
245+ const existing = makeAgent ( {
246+ personaId : WELCOME_GUIDE_PERSONA_ID ,
247+ agentCommand : "codex-acp" ,
248+ agentArgs : [ ] ,
249+ model : "gpt-5.6-sol" ,
250+ provider : "openai" ,
251+ } ) ;
252+
253+ assert . deepEqual (
254+ welcomeStarterRuntimeUpdate ( existing , {
255+ name : "Fizz" ,
256+ agentCommand : "claude-agent-acp" ,
257+ agentArgs : [ ] ,
258+ mcpCommand : "" ,
259+ } ) ,
260+ {
261+ pubkey : PUB_A ,
262+ agentCommand : "claude-agent-acp" ,
263+ harnessOverride : true ,
264+ agentArgs : [ ] ,
265+ mcpCommand : "" ,
266+ model : null ,
267+ provider : null ,
268+ } ,
269+ ) ;
270+ } ) ;
271+
272+ test ( "existing Welcome starter needs no update when runtime already matches" , ( ) => {
273+ const existing = makeAgent ( {
274+ personaId : WELCOME_GUIDE_PERSONA_ID ,
275+ agentCommand : "codex-acp" ,
276+ agentArgs : [ "--same" ] ,
277+ } ) ;
278+
279+ assert . equal (
280+ welcomeStarterRuntimeUpdate ( existing , {
281+ name : "Fizz" ,
282+ agentCommand : "codex-acp" ,
283+ agentArgs : [ "--same" ] ,
284+ mcpCommand : "buzz-dev-mcp" ,
285+ model : null ,
286+ provider : null ,
287+ } ) ,
288+ null ,
289+ ) ;
290+ } ) ;
291+
208292test ( "welcome team starter definitions and role identities are stable" , ( ) => {
209293 assert . equal ( WELCOME_TEAM_ID , "builtin-team:welcome" ) ;
210294 assert . deepEqual ( WELCOME_TEAM_STARTERS , [
0 commit comments