diff --git a/packages/webui/src/public/bus.js b/packages/webui/src/public/bus.js index 502cd003b..b0ad1875e 100644 --- a/packages/webui/src/public/bus.js +++ b/packages/webui/src/public/bus.js @@ -496,7 +496,7 @@ return r?`
${txt(r.text)}${r.code?` (${txt(r.code)})`:''}
That is not an organization address.
| Agent | State | Actions |
|---|
| Agent | State | ${scope ? '' : 'Actions | '}
|---|
${!anyRead && o.rows.length ? 'Agents not read' : filtered ? 'Nothing matches these filters' : 'No agents'}
`; const stateCounts = new Map(); for (const a of inOrg) stateCounts.set(a.state, (stateCounts.get(a.state) || 0) + 1); diff --git a/packages/webui/tests/system-agents-browser.test.mjs b/packages/webui/tests/system-agents-browser.test.mjs index b429e079f..be3941798 100644 --- a/packages/webui/tests/system-agents-browser.test.mjs +++ b/packages/webui/tests/system-agents-browser.test.mjs @@ -126,7 +126,7 @@ test('#/agents lists both organizations\' agents in one table, each row with its assert.match(await text('[data-ws-agent="beta:research-2"] .t2'), new RegExp(`org:hire-${HIRE}`)); assert.match(await text('[data-ws-agent="acme:chief"] [data-ws-role]'), /Chief of staff/); // Each row opens the agent in its own organization. - assert.equal(await b.evaluate('document.querySelector(\'[data-ws-agent="beta:pm"] a[data-ws-open]\')?.getAttribute("href")'), '#/orgs/beta/agents'); + assert.equal(await b.evaluate('document.querySelector(\'[data-ws-agent="beta:pm"] a[data-ws-open]\')?.getAttribute("href")'), '#/orgs/beta/agents?agent=pm'); }); test('the organization and state filters live in the hash and survive a reload', async t => { @@ -164,6 +164,8 @@ test('firing beta\'s agent from #/agents while acme was opened last reaches beta await b.evaluate('window.__answers.push({ body: { id: "dec-fire-1", op: "resolved", choice: "yes" } })'); await b.evaluate('document.querySelector(\'[data-ws-agent="beta:pm"] [data-agent-fire-yes]\').click()'); await wait('/Fired pm/.test(document.querySelector("[data-ws-agents] [data-agents-receipt]")?.textContent ?? "")'); + // The receipt names the organization by its label, not its id. + assert.match(await text('[data-ws-agents] [data-agents-receipt]'), /^Fired pm in Beta Works\./); const posts = await b.evaluate('window.__posts'); assert.deepEqual(posts.map(p => p.url), ['/api/orgs/beta/decisions/hire/start']); assert.deepEqual(JSON.parse(posts[0].body), { business: 'beta', hire: { op: 'fire', level: 'org', name: 'pm', reason: 'Fired from the Agents page.' } }); @@ -208,3 +210,33 @@ test('#/orgs/