fix: Show conflict resolution agents in HQ dashboard
getHeadquartersDashboard had no section for active conflict agents, so initiatives with a running conflict-* agent disappeared from all HQ sections. Add resolvingConflicts array to surface them.
This commit is contained in:
@@ -145,7 +145,40 @@ export function headquartersProcedures(publicProcedure: ProcedureBuilder) {
|
||||
planningInitiatives.sort((a, b) => a.since.localeCompare(b.since));
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Section 4: blockedPhases
|
||||
// Section 4: resolvingConflicts
|
||||
// -----------------------------------------------------------------------
|
||||
const resolvingConflicts: Array<{
|
||||
initiativeId: string;
|
||||
initiativeName: string;
|
||||
agentId: string;
|
||||
agentName: string;
|
||||
agentStatus: string;
|
||||
since: string;
|
||||
}> = [];
|
||||
|
||||
for (const agent of activeAgents) {
|
||||
if (
|
||||
agent.name?.startsWith('conflict-') &&
|
||||
(agent.status === 'running' || agent.status === 'waiting_for_input') &&
|
||||
agent.initiativeId
|
||||
) {
|
||||
const initiative = initiativeMap.get(agent.initiativeId);
|
||||
if (initiative) {
|
||||
resolvingConflicts.push({
|
||||
initiativeId: initiative.id,
|
||||
initiativeName: initiative.name,
|
||||
agentId: agent.id,
|
||||
agentName: agent.name,
|
||||
agentStatus: agent.status,
|
||||
since: agent.updatedAt.toISOString(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
resolvingConflicts.sort((a, b) => a.since.localeCompare(b.since));
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Section 5: blockedPhases
|
||||
// -----------------------------------------------------------------------
|
||||
const blockedPhases: Array<{
|
||||
initiativeId: string;
|
||||
@@ -207,6 +240,7 @@ export function headquartersProcedures(publicProcedure: ProcedureBuilder) {
|
||||
pendingReviewInitiatives,
|
||||
pendingReviewPhases,
|
||||
planningInitiatives,
|
||||
resolvingConflicts,
|
||||
blockedPhases,
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user