MCPcopy
hub / github.com/Dimillian/CodexMonitor / mergeCollabAgentStatuses

Function mergeCollabAgentStatuses

src/utils/threadItems.collab.ts:142–160  ·  view source on GitHub ↗
(...lists: CollabAgentStatus[][])

Source from the content-addressed store, hash-verified

140}
141
142function mergeCollabAgentStatuses(...lists: CollabAgentStatus[][]) {
143 const byThreadId = new Map<string, CollabAgentStatus>();
144 lists.forEach((list) => {
145 list.forEach((entry) => {
146 const existing = byThreadId.get(entry.threadId);
147 if (!existing) {
148 byThreadId.set(entry.threadId, { ...entry });
149 return;
150 }
151 byThreadId.set(entry.threadId, {
152 threadId: existing.threadId,
153 status: existing.status || entry.status,
154 nickname: existing.nickname ?? entry.nickname,
155 role: existing.role ?? entry.role,
156 });
157 });
158 });
159 return Array.from(byThreadId.values());
160}
161
162function withCollabAgentMetadata(
163 statuses: CollabAgentStatus[],

Callers 1

parseCollabToolCallItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected