mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 22:04:31 +00:00
fix: agent-only announce path, BB message IDs, sender identity, SSRF allowlist (#23970)
* fix(agents): defer announces until descendant cleanup settles * fix(bluebubbles): harden message metadata extraction * feat(contributors): rank by composite score (commits, PRs, LOC, tenure) * refactor(control-ui): move method guard after path checks to improve request handling * fix subagent completion announce when only current run is pending * fix(subagents): keep orchestrator runs active until descendants finish * fix: prepare PR feedback follow-ups (#23970) (thanks @tyler6204)
This commit is contained in:
@@ -113,6 +113,59 @@ export function countActiveDescendantRunsFromRuns(
|
||||
return count;
|
||||
}
|
||||
|
||||
function countPendingDescendantRunsInternal(
|
||||
runs: Map<string, SubagentRunRecord>,
|
||||
rootSessionKey: string,
|
||||
excludeRunId?: string,
|
||||
): number {
|
||||
const root = rootSessionKey.trim();
|
||||
if (!root) {
|
||||
return 0;
|
||||
}
|
||||
const excludedRunId = excludeRunId?.trim();
|
||||
const pending = [root];
|
||||
const visited = new Set<string>([root]);
|
||||
let count = 0;
|
||||
for (let index = 0; index < pending.length; index += 1) {
|
||||
const requester = pending[index];
|
||||
if (!requester) {
|
||||
continue;
|
||||
}
|
||||
for (const [runId, entry] of runs.entries()) {
|
||||
if (entry.requesterSessionKey !== requester) {
|
||||
continue;
|
||||
}
|
||||
const runEnded = typeof entry.endedAt === "number";
|
||||
const cleanupCompleted = typeof entry.cleanupCompletedAt === "number";
|
||||
if ((!runEnded || !cleanupCompleted) && runId !== excludedRunId) {
|
||||
count += 1;
|
||||
}
|
||||
const childKey = entry.childSessionKey.trim();
|
||||
if (!childKey || visited.has(childKey)) {
|
||||
continue;
|
||||
}
|
||||
visited.add(childKey);
|
||||
pending.push(childKey);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
export function countPendingDescendantRunsFromRuns(
|
||||
runs: Map<string, SubagentRunRecord>,
|
||||
rootSessionKey: string,
|
||||
): number {
|
||||
return countPendingDescendantRunsInternal(runs, rootSessionKey);
|
||||
}
|
||||
|
||||
export function countPendingDescendantRunsExcludingRunFromRuns(
|
||||
runs: Map<string, SubagentRunRecord>,
|
||||
rootSessionKey: string,
|
||||
excludeRunId: string,
|
||||
): number {
|
||||
return countPendingDescendantRunsInternal(runs, rootSessionKey, excludeRunId);
|
||||
}
|
||||
|
||||
export function listDescendantRunsForRequesterFromRuns(
|
||||
runs: Map<string, SubagentRunRecord>,
|
||||
rootSessionKey: string,
|
||||
|
||||
Reference in New Issue
Block a user