From cecc901854655786dfe8c041f5c4b8db5bfa78fe Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 19 Nov 2026 19:50:32 -0600 Subject: [PATCH] fix(webui): settings-s5: a failed turn in Messages whose body carries its own "\nDetails: " part shows its cause and "Details:" once, split on the first "\nDetails: " as chat.js does; #/settings/members and #/orgs//settings/members land on that organization's Agents page at #/settings/agents?org= (#1873, lane settings-s5) --- packages/webui/src/public/bus.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/webui/src/public/bus.js b/packages/webui/src/public/bus.js index 1ae74376a..71d97d3ba 100644 --- a/packages/webui/src/public/bus.js +++ b/packages/webui/src/public/bus.js @@ -703,7 +703,14 @@

Open decisions ${rows.length}

${body}

Open a decision for its seen, DM and closing history.

`; } - const messageText = m => m.from_role !== 'human' && typeof m.body === 'string' && m.body.startsWith('The turn failed: ') ? `The assistant couldn't reply. Try again, or check Agents.Details: ${txt(m.body.slice('The turn failed: '.length))}` : txt(m.body); + // #1873 settings slice 5: a failed turn whose body carries its own "\nDetails: " part (chat.js + // messageBody) shows its cause and that part once. + const messageText = m => { + if (m.from_role === 'human' || typeof m.body !== 'string' || !m.body.startsWith('The turn failed: ')) return txt(m.body); + const rest = m.body.slice('The turn failed: '.length), at = rest.indexOf('\nDetails: '); + if (at > 0) return `The assistant couldn't reply: ${txt(rest.slice(0, at))}Details: ${txt(rest.slice(at + '\nDetails: '.length))}`; + return `The assistant couldn't reply. Try again, or check Agents.Details: ${txt(rest)}`; + }; async function messagesView(get, q) { const after = q.get('after'); if (after !== null && !SAFE.test(after)) return notFound('The message cursor is not a message id.'); @@ -1923,6 +1930,8 @@ window.MosaicChat?.leave(chatPath); if (path === '/business') { location.replace('#/settings/business'); return; } if (path === '/settings/display') { location.replace('#/settings/appearance'); return; } + // #1873 settings slice 5: Members is gone from the nav; its old addresses land on the organization's Agents page. + if (path === '/settings/members') { location.replace(`#/settings/agents${window.MosaicOrg ? `?org=${enc(window.MosaicOrg.id)}` : ''}`); return; } // #1873 settings slice 4: the owner's page is Model setup; its old address lands there, query kept. if (path === '/settings/model-proxy') { location.replace(`#/settings/model-setup${query ? `?${query}` : ''}`); return; } // #1873 SP6: the Assistant page draws its own thread panes (assistant.js); every other page