Merge ID-only Team base into agent teamwork UI polish

This commit is contained in:
Dudu-0223 committed 2026-10-30 14:32:55 +08:00
commit 5a052d6767
321 files changed
+1771 -4966

No files matched your search

+4 -5
View File
@@ -273,7 +273,6 @@ describe('web e2e: agent teamwork panel', () => {
version: 2, childId: memberId, childCreatedAt: Date.now(), mode: 'external',
label: RESEARCHER_DESCRIPTION,
})
scaffold.ctx.subagentNames.bind(agent.session, memberId, 'lead/researcher')
const countAction = page.locator('[data-subagent-action]')
await countAction.waitFor()
await page.mouse.move(2, 2)
@@ -362,7 +361,7 @@ describe('web e2e: agent teamwork panel', () => {
})))
expect(primaryStyles.map(style => style.fontSize)).toEqual(['13px', '13px'])
expect(primaryStyles[1]).toEqual(primaryStyles[0])
expect(await member.getByText('researcher', { exact: true })
expect(await member.getByText('team-panel-researcher', { exact: true })
.evaluate(element => getComputedStyle(element).fontSize)).toBe('12px')
const memberHover = member.locator(':scope > div')
for (const target of [member, memberHover]) {
@@ -421,7 +420,7 @@ describe('web e2e: agent teamwork panel', () => {
taskId: task.id, expectedRevision: task.revision, action: 'claim',
})
await row.getByRole('img', { name: 'In progress', exact: true }).waitFor()
await row.locator('[data-team-task-owner]').filter({ hasText: 'Lead' }).waitFor()
await row.locator('[data-team-task-owner]').filter({ hasText: agent.id }).waitFor()
await action.getByRole('heading', { name: 'Shared tasks 1 in progress', exact: true }).waitFor()
expect(await action.getByRole('button', { name: /^(New task|Edit|Complete|Reopen|Delete)$/u }).count()).toBe(0)
expect(await action.locator('input, select, textarea').count()).toBe(0)
@@ -553,7 +552,7 @@ describe('web e2e: agent teamwork panel', () => {
}
const row = panel.getByRole('treeitem', { name: /Researcher/u })
const primary = row.getByText(RESEARCHER_DESCRIPTION, { exact: true })
const secondary = row.getByText('researcher', { exact: true })
const secondary = row.getByText('team-panel-researcher', { exact: true })
expect(await row.getByRole('button').count()).toBe(0)
expect(await primary.evaluate((element) => {
const style = getComputedStyle(element)
@@ -755,7 +754,7 @@ describe('web e2e: agent teamwork panel', () => {
expect(await row.getAttribute('data-expanded')).toBe('false')
expect(await row.locator('[data-team-task-details]').count()).toBe(0)
expect(await board.locator('[data-team-task-details]').count()).toBe(1)
expect(await emptyRow.locator('[data-team-task-owner]').textContent()).toBe('Owner: Lead')
expect(await emptyRow.locator('[data-team-task-owner]').textContent()).toBe(`Owner: ${agent.id}`)
expect(await emptyRow.locator('[data-team-task-details] p:not([data-team-task-owner])').textContent()).toBe(completed.description)
expect(await emptyRow.locator('dl, dt, dd').count()).toBe(0)
expect(await emptyRow.locator('[data-team-task-details]').textContent()).not.toContain(completed.id)
@@ -161,9 +161,7 @@ describe.skipIf(MODE === 'record')('web snapshot: Official native subagent bundl
if (notice?.data.source.kind !== 'subagent-settled') throw new Error('Native completion was not delivered to the parent')
expect(notice.data.source.senderSessionId).toBe(catalog[0]?.childId)
expect(notice.data.content).toContainEqual({ type: 'text', text: RESPONSE })
expect(dispatches[0]?.content).toEqual([{
type: 'text', text: `started subagent ${notice.data.source.senderSessionId}\nname: lead/native-worker`,
}])
expect(dispatches[0]?.content).toEqual([{ type: 'text', text: `started subagent ${notice.data.source.senderSessionId}` }])
expect(events.filter(event => event.type === 'turn/end')).toHaveLength(2)
expect(server.requests).toHaveLength(1)
expect(server.requests[0]?.body).toMatchObject({ model: 'fixture-model' })
+1 -3
View File
@@ -279,7 +279,6 @@ class ShippedChildAutoAdapter extends LlmAdapter {
this.parentPhase += 1
if (phase === 0 && prompt.includes(AUTO_PARENT_AUTHORIZED)) {
return toolChunks('parent-authorized', 'subagent', {
name: 'authorized',
description: 'Auto authorized child',
prompt: [
AUTO_CHILD_AUTHORIZED,
@@ -292,7 +291,6 @@ class ShippedChildAutoAdapter extends LlmAdapter {
if (phase === 1) return textChunks('PARENT_AUTHORIZED_SETTLED')
if (phase === 2 && prompt.includes(AUTO_PARENT_CONTINUABLE)) {
return toolChunks('parent-continuable', 'subagent', {
name: 'continuable',
description: 'Auto continuable child',
prompt: [
AUTO_CHILD_CONTINUABLE,
@@ -307,7 +305,7 @@ class ShippedChildAutoAdapter extends LlmAdapter {
throw new Error('continuable child id was not observed before parent adjustment')
}
return toolChunks('parent-adjust', 'send_message', {
name: 'lead/continuable',
agent_id: this.continuableChildId,
message: [
AUTO_CHILD_ADJUSTED,
`Replace the earlier no-deletion restriction: permanently delete exactly ${this.continuableDeletePath}.`,
@@ -157,7 +157,6 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
prompt: [{ type: 'text', text: INITIAL_PROMPT }],
parent,
})
scaffold.ctx.subagentNames.bind(parent.session, started.childId, 'lead/researcher')
childId = started.childId
await waitForAgentToSettle(scaffold, childId)
const liveInput = page.locator('[data-composer-input][contenteditable="true"]').first()
@@ -155,7 +155,6 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
signal: new AbortController().signal,
prompt: [{ type: 'text', text: INITIAL }], parent,
})
scaffold.ctx.subagentNames.bind(parent.session, started.childId, 'lead/interrupt-worker')
childId = started.childId
await waitFor(() => existsSync(readyFile), 'the held child turn to open')
+8 -8
View File
@@ -152,7 +152,7 @@ describe.skipIf(MODE === 'record')('web e2e: subagent task summary', () => {
await expectSummary(card, DESCRIPTION)
await capture('Running')
finishCall(agent, call, 'Delegation accepted.', false, { kind: 'activation', name: 'lead/foo' })
finishCall(agent, call, 'Delegation accepted.', false, { kind: 'activation', subagentId: 'child-foo' })
await scaffold.ctx.sessions.flush(agent.session)
await expect.poll(() => card.getAttribute('data-state')).toBe('ok')
await expectSummary(card, DESCRIPTION)
@@ -161,8 +161,8 @@ describe.skipIf(MODE === 'record')('web e2e: subagent task summary', () => {
await expectSummary(card, DESCRIPTION)
expect(await card.getByText('Agent response', { exact: true }).count()).toBe(0)
await card.getByText('Started', { exact: true }).waitFor()
expect(await card.locator('dt').allTextContents()).toEqual(['Agent task description', 'Agent name'])
expect(await card.locator('dd').allTextContents()).toEqual([`${DESCRIPTION}\nAdditional description context`, 'lead/foo'])
expect(await card.locator('dt').allTextContents()).toEqual(['Agent task description', 'ID'])
expect(await card.locator('dd').allTextContents()).toEqual([`${DESCRIPTION}\nAdditional description context`, 'child-foo'])
await capture('Creation receipt and complete task')
const beforeReload = tripwire.warnings.length
@@ -182,9 +182,9 @@ describe.skipIf(MODE === 'record')('web e2e: subagent task summary', () => {
it('falls back to the prompt, keeps synchronous replies in details, and preserves errors', async () => {
const cases = [
{ id: 'fallback', args: { prompt: 'Review the fallback summary.\nKeep the complete task in details.' }, summary: 'Review the fallback summary.', result: 'started subagent fallback-worker\nname: lead/fallback' },
{ id: 'fallback', args: { prompt: 'Review the fallback summary.\nKeep the complete task in details.' }, summary: 'Review the fallback summary.', result: 'started subagent fallback-worker' },
{ id: 'reply', args: { description: 'Check synchronous agent reply', prompt: 'Review the synchronous report.\nKeep every instruction available.' }, summary: 'Check synchronous agent reply', result: 'The synchronous agent found two issues.\nBoth are documented in the report.' },
{ id: 'title-only', args: {}, summary: '', result: 'started subagent empty-worker\nname: lead/empty' },
{ id: 'title-only', args: {}, summary: '', result: 'started subagent empty-worker' },
{ id: 'error', args: { description: 'Delegate a failing task', prompt: 'Attempt the requested delegation.' }, summary: 'Subagent capacity exceeded', result: 'Subagent capacity exceeded\nWait for an active agent to finish.', error: true },
]
const snapshots: string[] = []
@@ -244,13 +244,13 @@ describe.skipIf(MODE === 'record')('web e2e: subagent task summary', () => {
await expect.poll(() => card.getAttribute('data-state')).toBe('running')
await expectForkSummary()
await capture('Running')
finishCall(agent, call, 'started subagent fork-worker\nname: lead/context-reviewer')
finishCall(agent, call, 'started subagent fork-worker')
await scaffold.ctx.sessions.flush(agent.session)
await expect.poll(() => card.getAttribute('data-state')).toBe('ok')
await expandTask(card, prompt)
await expectForkSummary()
expect(await card.locator('dt').allTextContents()).toEqual(['Agent task description', 'Agent name'])
expect(await card.locator('dd').allTextContents()).toEqual([description, 'lead/context-reviewer'])
expect(await card.locator('dt').allTextContents()).toEqual(['Agent task description', 'ID'])
expect(await card.locator('dd').allTextContents()).toEqual([description, 'fork-worker'])
expect(await card.getByText('Agent response', { exact: true }).count()).toBe(0)
await capture('Creation receipt and complete task')
const beforeReload = tripwire.warnings.length