Merge branch 'feat/subagent-names' into integrate/team-descendants-names

This commit is contained in:
Dudu-0223 committed 2026-10-16 13:15:23 +08:00
commit d26e9bef67
8 files changed
+14 -14

No files matched your search

+3 -1
View File
@@ -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}.`,
+4 -5
View File
@@ -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' })
+2 -3
View File
@@ -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' })
@@ -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: \"<self-contained result>\" }). 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: \"<self-contained result>\" }). 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}}"
@@ -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: \"<self-contained result>\" }). 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: \"<self-contained result>\" }). 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]
@@ -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: \"<self-contained result>\" }). 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: \"<self-contained result>\" }). 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}}"
@@ -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: \"<self-contained result>\" }). 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: \"<self-contained result>\" }). 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]
@@ -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: \"<self-contained result>\" }). 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: \"<self-contained result>\" }). 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