diff --git a/apps/web/tests/shipped-composition.e2e.ts b/apps/web/tests/shipped-composition.e2e.ts index 9c7d827aba..2e9c164b24 100644 --- a/apps/web/tests/shipped-composition.e2e.ts +++ b/apps/web/tests/shipped-composition.e2e.ts @@ -279,6 +279,7 @@ class ShippedChildAutoAdapter extends LlmAdapter { this.parentPhase += 1 if (phase === 0 && prompt.includes(AUTO_PARENT_AUTHORIZED)) { return toolChunks('parent-authorized', 'subagent', { + name: 'auto-authorized', description: 'Auto authorized child', prompt: [ AUTO_CHILD_AUTHORIZED, @@ -291,6 +292,7 @@ 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: 'auto-continuable', description: 'Auto continuable child', prompt: [ AUTO_CHILD_CONTINUABLE, @@ -305,7 +307,7 @@ class ShippedChildAutoAdapter extends LlmAdapter { throw new Error('continuable child id was not observed before parent adjustment') } return toolChunks('parent-adjust', 'send_message', { - agent_id: this.continuableChildId, + name: 'auto-continuable', message: [ AUTO_CHILD_ADJUSTED, `Replace the earlier no-deletion restriction: permanently delete exactly ${this.continuableDeletePath}.`, diff --git a/apps/web/tests/subagent-conversation.e2e.ts b/apps/web/tests/subagent-conversation.e2e.ts index 5ef77670e3..e59258245d 100644 --- a/apps/web/tests/subagent-conversation.e2e.ts +++ b/apps/web/tests/subagent-conversation.e2e.ts @@ -1,4 +1,3 @@ -import { randomUUID } from 'node:crypto' import { mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { fileURLToPath } from 'node:url' @@ -145,7 +144,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () = await parentInput.press('Enter') expect(await parentSettled).toBe(parent.id) - const started = await scaffold.ctx.subagents.startActivation({ name: `child-${randomUUID()}`, + const started = await scaffold.ctx.subagents.startActivation({ name: 'researcher', delivery: 'parent', provider: 'spawn', label: LABEL, @@ -432,7 +431,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () = await page.getByRole('button', { name: '2 subagents' }).hover() await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click() const sidebarChat = page.locator('[data-sidebar-chat]') - await sidebarChat.getByText(/^Explain event sourcing in one sentence\.Your parent agent id is /).waitFor({ timeout: 15_000 }) + await sidebarChat.getByText(/^Explain event sourcing in one sentence\.Your name is /).waitFor({ timeout: 15_000 }) await compareOrRefreshGolden( SIDEBAR_CHAT_EXPECTED, await captureStableAria(page, '[data-sidebar-chat]', scaffold.workspaceCwd), @@ -455,7 +454,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () = await page.getByRole('button', { name: '2 subagents' }).hover() await page.getByRole('treeitem', { name: new RegExp(LABEL) }).click() await expect.poll( - () => page.getByText(/^Explain event sourcing in one sentence\.Your parent agent id is /).count(), + () => page.getByText(/^Explain event sourcing in one sentence\.Your name is /).count(), { timeout: 15_000 }, ).toBe(1) if (scaffold.ctx.agents.get(childId) !== undefined) { @@ -491,7 +490,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () = await expect.poll(() => requested, { timeout: 15_000 }).toBe(true) expect(await page.getByText('This subagent is read-only for now', { exact: true }).count()).toBe(0) expect(await page.getByRole('navigation', { name: 'Session hierarchy' }).count()).toBe(0) - expect(await page.getByText(/^Explain event sourcing in one sentence\.Your parent agent id is /).count()).toBe(0) + expect(await page.getByText(/^Explain event sourcing in one sentence\.Your name is /).count()).toBe(0) releaseCatalog() await page.getByRole('button', { name: `Switch subagent: ${LABEL}` }).waitFor({ timeout: 15_000 }) const input = page.getByRole('textbox', { name: 'Message or run a task, / commands, @ files or sessions' }) diff --git a/apps/web/tests/subagent-interrupt-ui.e2e.ts b/apps/web/tests/subagent-interrupt-ui.e2e.ts index 943cf88de6..2376d47c53 100644 --- a/apps/web/tests/subagent-interrupt-ui.e2e.ts +++ b/apps/web/tests/subagent-interrupt-ui.e2e.ts @@ -1,4 +1,3 @@ -import { randomUUID } from 'node:crypto' // Web e2e scenario: the composer's independent Stop interrupts a running // continuable child. The child holds its model turn open through a replay // hang entry; the browser proves Send and Stop coexist, the parent-offline @@ -149,7 +148,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co if (root === undefined) throw new Error('fresh workspace did not publish its parent Agent') parent = root // The child's first model call claims the primary override and holds. - const started = await scaffold.ctx.subagents.startActivation({ name: `child-${randomUUID()}`, + const started = await scaffold.ctx.subagents.startActivation({ name: 'interrupt-worker', delivery: 'parent', provider: 'spawn', label: LABEL, @@ -216,7 +215,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co name: 'Parent session offline; sending is unavailable but you can still stop the run', }) await input.waitFor({ timeout: 15_000 }) - await page.getByText(/^Explain event sourcing in one sentence\.Your parent agent id is /) + await page.getByText(/^Explain event sourcing in one sentence\.Your name is /) .waitFor({ timeout: 15_000 }) expect(await input.isDisabled()).toBe(true) const stop = page.getByRole('button', { name: 'Stop generating' }) diff --git a/snapshots/web/subagent-conversation/sidebar-chat.expected.md b/snapshots/web/subagent-conversation/sidebar-chat.expected.md index 748cd0db25..cfb363a243 100644 --- a/snapshots/web/subagent-conversation/sidebar-chat.expected.md +++ b/snapshots/web/subagent-conversation/sidebar-chat.expected.md @@ -1,4 +1,4 @@ -- text: "Explain event sourcing in one sentence.Your parent agent id is \"session-{{uuid}}\". Before you finish, send your result to that agent with send_message({ agent_id: \"session-{{uuid}}\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" +- text: "Explain event sourcing in one sentence.Your name is \"researcher\". Your parent agent name is \"lead\". Before you finish, send your result to that agent with send_message({ name: \"lead\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" - button "Copy" - status: Completed - button "Completed in {{duration}}" diff --git a/snapshots/web/subagent-conversation/ui-expanded.expected.md b/snapshots/web/subagent-conversation/ui-expanded.expected.md index 73e6b048d0..1394e0e716 100644 --- a/snapshots/web/subagent-conversation/ui-expanded.expected.md +++ b/snapshots/web/subagent-conversation/ui-expanded.expected.md @@ -13,7 +13,7 @@ - navigation "Turn navigation": - button "Jump to turn 1" - button "Jump to turn 2" -- text: "Explain event sourcing in one sentence.Your parent agent id is \"session-{{uuid}}\". Before you finish, send your result to that agent with send_message({ agent_id: \"session-{{uuid}}\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" +- text: "Explain event sourcing in one sentence.Your name is \"researcher\". Your parent agent name is \"lead\". Before you finish, send your result to that agent with send_message({ name: \"lead\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" - button "Copy" - status: Completed - button "Completed in {{duration}}" [expanded] diff --git a/snapshots/web/subagent-conversation/ui.expected.md b/snapshots/web/subagent-conversation/ui.expected.md index fd6280355e..50bab0e61a 100644 --- a/snapshots/web/subagent-conversation/ui.expected.md +++ b/snapshots/web/subagent-conversation/ui.expected.md @@ -13,7 +13,7 @@ - navigation "Turn navigation": - button "Jump to turn 1" - button "Jump to turn 2" -- text: "Explain event sourcing in one sentence.Your parent agent id is \"session-{{uuid}}\". Before you finish, send your result to that agent with send_message({ agent_id: \"session-{{uuid}}\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" +- text: "Explain event sourcing in one sentence.Your name is \"researcher\". Your parent agent name is \"lead\". Before you finish, send your result to that agent with send_message({ name: \"lead\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" - button "Copy" - status: Completed - button "Completed in {{duration}}" diff --git a/snapshots/web/subagent-interrupt/image-queue.expected.md b/snapshots/web/subagent-interrupt/image-queue.expected.md index df350804f1..9c8db1cd4a 100644 --- a/snapshots/web/subagent-interrupt/image-queue.expected.md +++ b/snapshots/web/subagent-interrupt/image-queue.expected.md @@ -12,7 +12,7 @@ - navigation "Turn navigation": - button "Jump to turn 1" - button "Jump to turn 2" -- text: "Explain event sourcing in one sentence.Your parent agent id is \"session-{{uuid}}\". Before you finish, send your result to that agent with send_message({ agent_id: \"session-{{uuid}}\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" +- text: "Explain event sourcing in one sentence.Your name is \"interrupt-worker\". Your parent agent name is \"lead\". Before you finish, send your result to that agent with send_message({ name: \"lead\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" - button "Copy" - status: Stopped - button "Stopped" [disabled] diff --git a/snapshots/web/subagent-interrupt/offline-composer.expected.md b/snapshots/web/subagent-interrupt/offline-composer.expected.md index 46af81e085..f50d28bbdb 100644 --- a/snapshots/web/subagent-interrupt/offline-composer.expected.md +++ b/snapshots/web/subagent-interrupt/offline-composer.expected.md @@ -9,7 +9,7 @@ - tablist: - tab "Chat" [selected] - tab "Trajectory" -- text: "Explain event sourcing in one sentence.Your parent agent id is \"session-{{uuid}}\". Before you finish, send your result to that agent with send_message({ agent_id: \"session-{{uuid}}\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" +- text: "Explain event sourcing in one sentence.Your name is \"interrupt-worker\". Your parent agent name is \"lead\". Before you finish, send your result to that agent with send_message({ name: \"lead\", message: \"\" }). The parent shares your workspace but does not automatically receive your transcript, tool output, or reasoning. Send earlier messages as well when a finding changes what the parent should do next; sending a message does not end your turn. {{clock}}" - button "Copy" - paragraph: partial - status: Deep diving