|
|
@@ -599,7 +599,7 @@ describe('headless stream-json snapshots', () => {
|
|
|
configPath: teamConfigPath,
|
|
|
binArgs: [
|
|
|
teamConfigPath,
|
|
|
- '请明确使用 Agent Teams,把调研和实现拆给两个 teammate,等待完成后汇总。',
|
|
|
+ '请先运行 workflow 检查,再使用 Agent Teams 把调研和实现拆给两个 teammate,等待完成后汇总。',
|
|
|
],
|
|
|
tsconfigPath,
|
|
|
processTimeoutMs: 60_000,
|
|
|
@@ -612,6 +612,15 @@ describe('headless stream-json snapshots', () => {
|
|
|
const parent = logs.find(log => typeof log.header.parentSession !== 'string')
|
|
|
if (parent === undefined) throw new Error('Agent Teams snapshot did not persist its Lead')
|
|
|
const rows = parseJsonl(parent.content)
|
|
|
+ const workflowChild = logs.find(log => parseJsonl(log.content).some(row => row.type === 'subagent/descriptor'
|
|
|
+ && (row.data as JsonObject).mode === 'one-shot'))
|
|
|
+ if (workflowChild === undefined) throw new Error('Team profile did not persist its workflow child')
|
|
|
+ const workflowRows = parseJsonl(workflowChild.content)
|
|
|
+ expect(workflowRows.find(row => row.type === 'subagent/descriptor')?.data)
|
|
|
+ .toMatchObject({ mode: 'one-shot', provider: 'spawn' })
|
|
|
+ expect(workflowRows.filter(row => row.type === 'user/message'
|
|
|
+ && ((row.data as JsonObject).source as JsonObject).kind === 'user').map(row => row.data))
|
|
|
+ .toEqual([expect.objectContaining({ content: [{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' }] })])
|
|
|
const members = rows.filter(row => row.type === 'team/member')
|
|
|
.map(row => ((row.data as JsonObject).member as JsonObject))
|
|
|
const tasks = rows.filter(row => row.type === 'team/task')
|
|
|
@@ -661,7 +670,7 @@ describe('headless stream-json snapshots', () => {
|
|
|
return (JSON.parse(data.arguments) as JsonObject).action === 'complete'
|
|
|
})
|
|
|
const identityReminders = logs.flatMap((log) => {
|
|
|
- if (log === parent) return []
|
|
|
+ if (log === parent || log === workflowChild) return []
|
|
|
const initial = parseJsonl(log.content).find(row => row.type === 'user/message'
|
|
|
&& ((row.data as JsonObject).source as JsonObject).kind === 'user')
|
|
|
if (initial === undefined) throw new Error('Teammate Session has no initial task')
|
|
|
@@ -673,6 +682,7 @@ describe('headless stream-json snapshots', () => {
|
|
|
}).sort()
|
|
|
projection = {
|
|
|
sessions: logs.length,
|
|
|
+ workflowStopReason: (rows.find(row => row.type === 'tool-workflow/run-end')?.data as JsonObject)?.stopReason,
|
|
|
memberEdges: members.length,
|
|
|
identityReminders,
|
|
|
activeMembers: members.filter(member => member.phase === 'active').map(member => member.name).sort(),
|
|
|
@@ -719,7 +729,7 @@ describe('headless stream-json snapshots', () => {
|
|
|
],
|
|
|
"memberEdges": 4,
|
|
|
"queuedMessages": 2,
|
|
|
- "sessions": 3,
|
|
|
+ "sessions": 4,
|
|
|
"steerEvidence": {
|
|
|
"completedAfterMessage": true,
|
|
|
"enteredOpenTurn": true,
|
|
|
@@ -739,6 +749,7 @@ describe('headless stream-json snapshots', () => {
|
|
|
},
|
|
|
],
|
|
|
"waited": true,
|
|
|
+ "workflowStopReason": "completed",
|
|
|
}
|
|
|
`)
|
|
|
}, 75_000)
|