feat(team): improve team orchestration diagnostics

This commit is contained in:
777genius 2026-05-03 13:27:48 +03:00
parent d0341e58af
commit d495f8d8f2
4 changed files with 22 additions and 11 deletions

View file

@ -375,7 +375,7 @@ function formatNotificationClockTime(date: Date): string {
function buildRateLimitNotificationBody(plan: ReturnType<typeof planRateLimitAutoResume>): string {
if (plan.kind === 'scheduled') {
return `Auto-resume scheduled at ${formatNotificationClockTime(plan.resetTime)}`;
return `Auto-resume scheduled at ${formatNotificationClockTime(new Date(plan.fireAtMs))}`;
}
return 'Manual restart needed';
}

View file

@ -24390,10 +24390,11 @@ export class TeamProvisioningService {
missingNames.length > 0
? missingNames.length
: Math.max(0, launchSummary.pendingCount + launchSummary.failedCount);
const joinedCount = Math.max(
0,
Math.min(expectedCount, launchSummary.confirmedCount || expectedCount - missingCount)
);
const rawJoinedCount =
typeof launchSummary.confirmedCount === 'number'
? launchSummary.confirmedCount
: expectedCount - missingCount;
const joinedCount = Math.max(0, Math.min(expectedCount, rawJoinedCount));
const missingLabel =
missingNames.length > 0
? `${missingNames.map((name) => `@${name}`).join(', ')} did not join`

View file

@ -1862,7 +1862,9 @@ export const TeamDetailView = memo(function TeamDetailView({
return;
}
const section = document.querySelector<HTMLElement>(`[data-section-id="${sectionId}"]`);
const section = contentRef.current?.querySelector<HTMLElement>(
`[data-section-id="${sectionId}"]`
);
if (!section) return;
section.dispatchEvent(new CustomEvent('team-section-navigate'));
clearTeamSectionFocus();

View file

@ -1326,17 +1326,25 @@ function detectBlockedTaskNotifications(
for (const task of newTasks) {
const oldTask = oldTaskMap.get(`${task.teamName}:${task.id}`);
const oldBlockedBy = oldTask?.blockedBy?.filter(Boolean) ?? [];
const newBlockedBy = task.blockedBy?.filter(Boolean) ?? [];
const key = `${task.teamName}:${task.id}:${newBlockedBy.join(',')}`;
const oldBlockedBy = new Set(oldTask?.blockedBy?.filter(Boolean) ?? []);
const newBlockedBy = Array.from(new Set(task.blockedBy?.filter(Boolean) ?? []));
const taskKeyPrefix = `${task.teamName}:${task.id}:`;
const key = `${taskKeyPrefix}${[...newBlockedBy].sort().join(',')}`;
const addedBlockedBy = newBlockedBy.filter((id) => !oldBlockedBy.has(id));
if (newBlockedBy.length > 0 && oldBlockedBy.length === 0) {
for (const existingKey of Array.from(notifiedBlockedTaskKeys)) {
if (existingKey.startsWith(taskKeyPrefix) && existingKey !== key) {
notifiedBlockedTaskKeys.delete(existingKey);
}
}
if (newBlockedBy.length > 0 && addedBlockedBy.length > 0) {
if (notifiedBlockedTaskKeys.has(key)) continue;
notifiedBlockedTaskKeys.add(key);
fireTaskBlockedNotification(task, newBlockedBy, !notifyEnabled);
} else if (newBlockedBy.length === 0) {
for (const existingKey of Array.from(notifiedBlockedTaskKeys)) {
if (existingKey.startsWith(`${task.teamName}:${task.id}:`)) {
if (existingKey.startsWith(taskKeyPrefix)) {
notifiedBlockedTaskKeys.delete(existingKey);
}
}