${txt(value?.message||'Launch settings are not configured.')}
The definition stays an assistant one. Holder and credentials stay hand edits. Stop ends the runs of your threads; the assistant starts again when you next write to it.
${forms}${canSend?'Changes are checked and logged with your identity.':'Changes require signed-in send mode.'}
human-required<\/code>/);
+ assert.equal(names,usage);
+ assert.equal(names.includes('assistant-form')||names.includes('launch-settings-form'),false);
+ await b.navigate(`http://127.0.0.1:${port}/?fail=names#/settings`);await wait('!!document.querySelector(".assistant-form")');
+ assert.equal(await b.evaluate('document.querySelector(".assistant-form").textContent.includes("The current name could not be read.")'),true);
+ assert.equal(await b.evaluate('document.querySelector("[data-assistant-field=name]").value'),'');
+ assert.equal(await b.evaluate('!!document.querySelector("#launch-settings-form")'),true);
+ }finally{await b.close();await close(web);}
+});
+// Row 167 (#1664): one settings snapshot. Each POST answers the fixture with the next revision
+// (b, c, then d), and reads after it serve that answer, as the server would. A save in one form
+// gives the other form's open draft the revision it returned.
+const oneSnapshot=`window.posts=[];window.saved=null;const original=window.fetch;window.fetch=async(url,options={})=>{if(url==='/api/config')return new Response(JSON.stringify({send:true}));if(url==='/api/settings'&&options.method==='POST'){posts.push(JSON.parse(options.body));window.saved={...(window.saved||window.fixture),revision:'bcd'[posts.length-1].repeat(64)};return new Response(JSON.stringify(window.saved));}if(url==='/api/settings'&&window.saved){const read=await (await original(url,options)).json();return new Response(JSON.stringify({...read,launch:window.saved}));}return original(url,options);};`;
+async function snapshotPage(){
+ const withAssistant={...launch,assistants:{assistant:{definition:'assistant',vars:{model:'claude-sonnet-5-5'},tracker:null}}};
+ const bus={inbox:async()=>[],tasks:async()=>[],agents:async()=>[],messages:async()=>({messages:[],unread:0}),names:async()=>[{instance:'assistant',name:'piper',at:'2026-10-18T00:00:00.000Z'}]};
+ const web=await startServer({port:0,board:'http://127.0.0.1:9',bus,reads:{settings:()=>({business:'acme',release:'fixture',notifier:{binding:'fixture'},launch:withAssistant})}}),b=await browser();
+ await b.call('Page.addScriptToEvaluateOnNewDocument',{source:`window.fixture=${JSON.stringify(withAssistant)};${oneSnapshot}`});
+ const q=sel=>`document.querySelector(${JSON.stringify(sel)})`;
+ const wait=expr=>b.evaluate(`(async()=>{for(let n=0;n<200;n++){if(${expr})return true;await new Promise(r=>setTimeout(r,30));}throw Error('wait failed: '+${JSON.stringify(expr)});})()`);
+ await b.navigate(`http://127.0.0.1:${web.address().port}/#/settings`);
+ await wait(`${q('#launch-settings-form button[type=submit]')}?.disabled===false&&${q('.assistant-form button[type=submit]')}?.disabled===false`);
+ const total=()=>b.evaluate(`[...document.querySelectorAll('[data-setting]')].find(e=>e.dataset.setting===${JSON.stringify(JSON.stringify(['total']))}).value`);
+ return {web,b,q,wait,total,
+ setTotal:value=>b.evaluate(`(()=>{const e=[...document.querySelectorAll('[data-setting]')].find(e=>e.dataset.setting===${JSON.stringify(JSON.stringify(['total']))});e.value=${JSON.stringify(value)};e.dispatchEvent(new Event('input',{bubbles:true}));return true;})()`),
+ setTracker:value=>b.evaluate(`(()=>{const e=${q('.assistant-form [data-assistant-field="tracker"]')};e.value=${JSON.stringify(value)};e.dispatchEvent(new Event('input',{bubbles:true}));return true;})()`),
+ tracker:()=>b.evaluate(`${q('.assistant-form [data-assistant-field="tracker"]')}.value`),
+ submitLaunch:()=>b.evaluate(`${q('#launch-settings-form')}.requestSubmit();true`),
+ submitAssistant:()=>b.evaluate(`${q('.assistant-form')}.requestSubmit();true`),
+ };
+}
+test('Row 167 with a limits draft open, an assistant save gives the limits submit its revision and the typed limit stays',{timeout:90000},async()=>{
+ const p=await snapshotPage();
+ try{
+ await p.setTotal('7');await p.setTracker('{"project":"P19"}');await p.submitAssistant();
+ await p.wait(`${p.q('[data-assistant-receipt]')}?.textContent.includes("Assistant settings saved")`);
+ assert.equal((await p.b.evaluate('posts[0]')).revision,launch.revision);
+ assert.equal(await p.total(),'7');
+ await p.submitLaunch();await p.wait(`${p.q('#launch-settings-receipt')}?.textContent.includes("saved")`);
+ const second=await p.b.evaluate('posts[1]');
+ assert.equal(second.revision,'b'.repeat(64));
+ assert.equal(second.limits.total,7);
+ }finally{await p.b.close();await close(p.web);}
+});
+test('Row 167 with an assistant draft open, a launch save gives the assistant submit its revision, and reload reads the current one',{timeout:90000},async()=>{
+ const p=await snapshotPage();
+ try{
+ await p.setTracker('{"project":"P19"}');await p.setTotal('7');await p.submitLaunch();
+ await p.wait(`${p.q('#launch-settings-receipt')}?.textContent.includes("saved")`);
+ assert.equal((await p.b.evaluate('posts[0]')).revision,launch.revision);
+ assert.equal(await p.tracker(),'{"project":"P19"}');
+ await p.submitAssistant();await p.wait(`${p.q('[data-assistant-receipt]')}?.textContent.includes("Assistant settings saved")`);
+ assert.deepEqual(await p.b.evaluate('posts[1]'),{revision:'b'.repeat(64),assistants:{assistant:{tracker:{project:'P19'}}}});
+ // Someone else writes, so the file is at d. The reload button clears the snapshot even with an
+ // assistant draft open, and the draft's submit then carries d.
+ await p.setTracker('{"project":"P20"}');await p.b.evaluate(`window.saved={...window.saved,revision:'d'.repeat(64)};${p.q('#launch-settings-reload')}.click();true`);
+ await p.wait(`${p.q('#launch-settings-receipt')}?.textContent===''`);
+ assert.equal(await p.tracker(),'{"project":"P20"}');
+ await p.submitAssistant();await p.wait('posts.length===3');
+ assert.deepEqual(await p.b.evaluate('posts[2]'),{revision:'d'.repeat(64),assistants:{assistant:{tracker:{project:'P20'}}}});
+ }finally{await p.b.close();await close(p.web);}
+});