feat(panel): add Native Swarm mode compatibility and distinct worker telemetry

- Guard conversation_parents against forked Swarm Workers (subagentSpec or trajectoryType != 22) and selectively decode CORTEX_STEP_TYPE_SYSTEM_MESSAGE (step_type = 101) for child trajectories only
- Parse swarm, post_message, read_board, and swarm_wait tool calls, split zero-human-turn worker trajectories on initial brief / @mention / cron wakeup boundaries, and downgrade swarm_wait parked workers from RUNNING to IDLE ('waiting') while surfacing killed workers ('killed')
- Scan brain/<id>/.system_generated/swarm/members.json with mtime+size memoization, sort workers chronologically, assign independent swarm_worker ordinals (蜂k / Wk) separate from standard subagents (子k / Sk) and side questions (问k / Qk), and preserve 100% of worker token/USD billing
- Render Swarm counts, titles, scrollable sorted live worker lists, and one-shot auto-focus when navigating host routes to /c/<worker-uuid>, backed by E2E and binary SQLite tests
This commit is contained in:
fish
2026-11-19 09:36:05 +09:00
parent 352d6bdfef
commit 2c211f67cc
19 changed files with 3077 additions and 246 deletions
+27
View File
@@ -17,6 +17,8 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'header.lockedSession': 'Pinned Session ({id})',
'header.lockedMeta': 'Pinned',
'header.convMetaWithSubs': 'Main {main} · {subs} sub ({total} steps)',
'header.convMetaWithSwarm': 'Main {main} · {swarm} swarm ({total} steps)',
'header.convMetaWithSwarmAndSubs': 'Main {main} · {swarm} swarm · {subs} sub ({total} steps)',
'header.convMetaSteps': '{count} steps',
'header.hasUpdate': 'Update',
'header.upgradeToVer': 'Update v{ver}',
@@ -55,6 +57,11 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'fmt.subAgent': 'Subagent',
'fmt.subBadge': 'S{index}',
'fmt.subBadgeShort': 'Sub',
'fmt.swarmAgent': 'Swarm',
'fmt.swarmBadge': 'W{index}',
'fmt.swarmBadgeShort': 'Swarm',
'fmt.swarmMonitorHint': 'Monitor',
'fmt.swarmNarratorHint': 'Narrator',
'fmt.sideQuestion': 'Side Question',
'fmt.sideBadge': 'Q{index}',
'fmt.sideBadgeShort': 'Q',
@@ -68,6 +75,7 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'capsule.multiZero': '0 active',
'capsule.multiRunning': '{count} active',
'capsule.multiRunningWithSubs': '{count} active · {subs} sub',
'capsule.multiRunningWithSwarm': '{count} active · {subs} swarm',
'capsule.tpsRunning': 'Running',
'capsule.tpsIdle': 'Idle',
'capsule.quotaLeft': '{pct}% left',
@@ -88,6 +96,7 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'multi.empty': 'No active running sessions',
'multi.allIdle': 'All idle',
'multi.metaWithSubs': '{main} main · {subs} subagents active',
'multi.metaWithSwarm': '{main} main · {subs} swarm active',
'multi.metaMainOnly': '{main} sessions active',
'multi.hereTag': 'Here',
'multi.inspectSessionTitle': 'Inspect session in monitor: {title}',
@@ -184,10 +193,16 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'live.thinking': 'Thinking',
'live.generating': 'Generating',
'live.running': 'Running',
'live.waiting': 'Waiting',
'live.killed': 'Killed',
'live.done': 'Done',
'live.doneWithSteps': 'Done ({steps} steps)',
'live.waitingWithSteps': 'Waiting ({steps} steps)',
'live.killedWithSteps': 'Killed ({steps} steps)',
'live.subToggleRunning': 'Subagents {run}/{total} {arrow}',
'live.subToggleIdle': 'Subagents ({total}) {arrow}',
'live.swarmToggleRunning': 'Swarm {run}/{total} {arrow}',
'live.swarmToggleIdle': 'Swarm ({total}) {arrow}',
'live.subCollapseTitle': 'Collapse subagent list',
'live.subExpandTitle': 'Expand subagent activity list',
@@ -558,6 +573,15 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'live.act.invoke_subagent': 'Invoke Subagent',
'live.act.send_message': 'Message Subagent',
'live.act.manage_subagents': 'Manage Subagents',
'live.act.swarm_add': 'Spawn Worker',
'live.act.swarm_title': 'Name Swarm',
'live.act.swarm_kill': 'Kill Worker',
'live.act.swarm_model': 'Switch Worker Model',
'live.act.swarm_channel': 'Swarm Channel',
'live.act.swarm_status': 'Check Swarm',
'live.act.post_message': 'Post to Board',
'live.act.read_board': 'Read Board',
'live.act.swarm_wait': 'Parked on Board',
'live.act.manage_task': 'Manage Task',
'live.act.schedule': 'Schedule Task',
'live.act.ask_question': 'Waiting for User Choice',
@@ -568,6 +592,9 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
'live.act.compacting': 'Compacting Context',
'live.act.responding': 'Responding',
'live.act.waiting_subagent': 'Waiting for Subagent',
'live.act.waiting_swarm': 'Waiting for Swarm',
'live.act.swarm_waiting': 'Waiting',
'live.act.swarm_killed': 'Killed',
'live.act.starting': 'Starting',
'live.act.done': 'Completed',
'live.act.awaitingApproval': 'Awaiting Approval · {label}',
+27
View File
@@ -17,6 +17,8 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'header.lockedSession': '已锁定会话 ({id})',
'header.lockedMeta': '已锁定',
'header.convMetaWithSubs': '主{main} · {subs}子 (共{total}步)',
'header.convMetaWithSwarm': '主{main} · {swarm}蜂 (共{total}步)',
'header.convMetaWithSwarmAndSubs': '主{main} · {swarm}蜂 · {subs}子 (共{total}步)',
'header.convMetaSteps': '{count}步',
'header.hasUpdate': '有新版本',
'header.upgradeToVer': '升级 v{ver}',
@@ -55,6 +57,11 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'fmt.subAgent': '子代理',
'fmt.subBadge': '子{index}',
'fmt.subBadgeShort': '子',
'fmt.swarmAgent': '蜂群',
'fmt.swarmBadge': '蜂{index}',
'fmt.swarmBadgeShort': '蜂',
'fmt.swarmMonitorHint': '巡检',
'fmt.swarmNarratorHint': '旁白',
'fmt.sideQuestion': '旁路提问',
'fmt.sideBadge': '旁{index}',
'fmt.sideBadgeShort': '旁',
@@ -68,6 +75,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'capsule.multiZero': '0 运行中',
'capsule.multiRunning': '{count} 运行中',
'capsule.multiRunningWithSubs': '{count} 运行 · {subs} 子',
'capsule.multiRunningWithSwarm': '{count} 运行 · {subs} 蜂',
'capsule.tpsRunning': '生成中',
'capsule.tpsIdle': '待命',
'capsule.quotaLeft': '余 {pct}%',
@@ -88,6 +96,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'multi.empty': '当前暂无在线运行的会话',
'multi.allIdle': '全部待命',
'multi.metaWithSubs': '{main} 主会话 · {subs} 子代理运行中',
'multi.metaWithSwarm': '{main} 主会话 · {subs} 蜂群运行中',
'multi.metaMainOnly': '{main} 个会话运行中',
'multi.hereTag': '本窗',
'multi.inspectSessionTitle': '点击在监控面板中检视会话:{title}',
@@ -184,10 +193,16 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.thinking': '推理中',
'live.generating': '生成中',
'live.running': '运行中',
'live.waiting': '待命中',
'live.killed': '已终止',
'live.done': '已完成',
'live.doneWithSteps': '已完成 ({steps} 步)',
'live.waitingWithSteps': '待命中 ({steps} 步)',
'live.killedWithSteps': '已终止 ({steps} 步)',
'live.subToggleRunning': '子代理 {run}/{total} {arrow}',
'live.subToggleIdle': '子代理 ({total}) {arrow}',
'live.swarmToggleRunning': '蜂群 {run}/{total} {arrow}',
'live.swarmToggleIdle': '蜂群 ({total}) {arrow}',
'live.subCollapseTitle': '点击收起子代理列表',
'live.subExpandTitle': '点击展开查看子代理缩略状态',
@@ -558,6 +573,15 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.act.invoke_subagent': '调用子代理',
'live.act.send_message': '通信子代理',
'live.act.manage_subagents': '管理子代理',
'live.act.swarm_add': '派生工蜂',
'live.act.swarm_title': '命名蜂群',
'live.act.swarm_kill': '终止工蜂',
'live.act.swarm_model': '切换工蜂模型',
'live.act.swarm_channel': '蜂群频道',
'live.act.swarm_status': '巡检蜂群',
'live.act.post_message': '发布看板',
'live.act.read_board': '读取看板',
'live.act.swarm_wait': '看板待命',
'live.act.manage_task': '后台任务',
'live.act.schedule': '定时任务',
'live.act.ask_question': '等待用户选择',
@@ -568,6 +592,9 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.act.compacting': '上下文压缩',
'live.act.responding': '正在输出回复',
'live.act.waiting_subagent': '等待子代理',
'live.act.waiting_swarm': '等待工蜂',
'live.act.swarm_waiting': '待命中',
'live.act.swarm_killed': '已终止',
'live.act.starting': '启动中',
'live.act.done': '已完成',
'live.act.awaitingApproval': '等待确认 · {label}',