mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
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:
@@ -2297,16 +2297,26 @@ export function mountWindowOverlay() {
|
||||
syncCapsuleSlotNodes(capsuleSlots, capsuleSeps, slotKeys, slotCtx);
|
||||
}
|
||||
|
||||
function renderMultiRunningPanel(rawRunningList, runningCount, runningSubCount, hostRouteConversationId) {
|
||||
function renderMultiRunningPanel(
|
||||
rawRunningList,
|
||||
runningCount,
|
||||
runningSubCount,
|
||||
hostRouteConversationId,
|
||||
runningSwarmCount = 0
|
||||
) {
|
||||
if (!multiOpen || document.hidden) {
|
||||
multiRunningWidget.refs.pauseTicker();
|
||||
return;
|
||||
}
|
||||
const isPureSwarm = runningSubCount > 0 && runningSwarmCount === runningSubCount;
|
||||
patchText(
|
||||
multiRunningMetaEl,
|
||||
runningCount > 0
|
||||
? runningSubCount > 0
|
||||
? t('multi.metaWithSubs', { main: runningCount, subs: runningSubCount })
|
||||
? t(isPureSwarm ? 'multi.metaWithSwarm' : 'multi.metaWithSubs', {
|
||||
main: runningCount,
|
||||
subs: runningSubCount,
|
||||
})
|
||||
: t('multi.metaMainOnly', { main: runningCount })
|
||||
: t('multi.allIdle')
|
||||
);
|
||||
@@ -2377,13 +2387,19 @@ export function mountWindowOverlay() {
|
||||
ctxAgent,
|
||||
aggregated,
|
||||
});
|
||||
const { rawRunningList, runningCount, runningSubCount, hasWaiting, multiBtnText } =
|
||||
resolveMultiSessionCapsuleState(telemetry, {
|
||||
agents,
|
||||
aggregated,
|
||||
latestTokPerSec: overviewActive.latestTokPerSec ?? null,
|
||||
contextUsedPct: slotCtx.usedPct,
|
||||
});
|
||||
const {
|
||||
rawRunningList,
|
||||
runningCount,
|
||||
runningSubCount,
|
||||
runningSwarmCount,
|
||||
hasWaiting,
|
||||
multiBtnText,
|
||||
} = resolveMultiSessionCapsuleState(telemetry, {
|
||||
agents,
|
||||
aggregated,
|
||||
latestTokPerSec: overviewActive.latestTokPerSec ?? null,
|
||||
contextUsedPct: slotCtx.usedPct,
|
||||
});
|
||||
|
||||
patchClasses(multiBtn, {
|
||||
'is-running': runningCount > 0 && !hasWaiting,
|
||||
@@ -2395,7 +2411,8 @@ export function mountWindowOverlay() {
|
||||
rawRunningList,
|
||||
runningCount,
|
||||
runningSubCount,
|
||||
telSt.hostRouteConversationId
|
||||
telSt.hostRouteConversationId,
|
||||
runningSwarmCount
|
||||
);
|
||||
|
||||
patchClasses(capsuleBtn, { 'is-running': slotCtx.isRunning });
|
||||
|
||||
Reference in New Issue
Block a user