nexus-agents 2.123.3 → 2.123.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SHGWPSEJ.js → chunk-NPRLDYPV.js} +44 -17
- package/dist/chunk-NPRLDYPV.js.map +1 -0
- package/dist/{chunk-G6FG6GMT.js → chunk-RBTHFAKW.js} +2 -2
- package/dist/{chunk-OE5D4YHR.js → chunk-S4YUKUTS.js} +3 -3
- package/dist/{chunk-4Q4S3C2T.js → chunk-YNSSSY5X.js} +39 -7
- package/dist/{chunk-4Q4S3C2T.js.map → chunk-YNSSSY5X.js.map} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -4
- package/dist/{consensus-vote-YYSDHHSQ.js → consensus-vote-Y6LJI44O.js} +2 -2
- package/dist/{consensus-vote-types-WGBFeT7y.d.ts → consensus-vote-types-DdruG9-X.d.ts} +7 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/{setup-command-MF43CGQY.js → setup-command-SBPGWYG7.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-SHGWPSEJ.js.map +0 -1
- /package/dist/{chunk-G6FG6GMT.js.map → chunk-RBTHFAKW.js.map} +0 -0
- /package/dist/{chunk-OE5D4YHR.js.map → chunk-S4YUKUTS.js.map} +0 -0
- /package/dist/{consensus-vote-YYSDHHSQ.js.map → consensus-vote-Y6LJI44O.js.map} +0 -0
- /package/dist/{setup-command-MF43CGQY.js.map → setup-command-SBPGWYG7.js.map} +0 -0
|
@@ -1756,6 +1756,9 @@ async function executeWithRetries(opts) {
|
|
|
1756
1756
|
|
|
1757
1757
|
// src/cli/voter-agents-deadline.ts
|
|
1758
1758
|
var DEADLINE_MESSAGE = "overall consensus deadline exceeded";
|
|
1759
|
+
function shouldRetryOnFallback(result, used, fallback) {
|
|
1760
|
+
return result.source === "error" && result.error !== DEADLINE_MESSAGE && adapterCliKey(used) !== adapterCliKey(fallback);
|
|
1761
|
+
}
|
|
1759
1762
|
function adapterCliKey(adapter) {
|
|
1760
1763
|
return adapter.name ?? adapter.providerId;
|
|
1761
1764
|
}
|
|
@@ -1799,18 +1802,31 @@ async function launchVotesWithOverallDeadline(input) {
|
|
|
1799
1802
|
} = input;
|
|
1800
1803
|
const startedAt = Date.now();
|
|
1801
1804
|
const serialize = createKeyedSerializer();
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
const remaining = Math.max(1, overallDeadlineMs -
|
|
1805
|
+
const voteOnAdapter = (role, adapter) => (
|
|
1806
|
+
// Serialize per CLI so concurrent same-CLI calls don't race that CLI's
|
|
1807
|
+
// OAuth refresh (#3348). The deadline is measured when the vote actually
|
|
1808
|
+
// starts, so a queued role still gets a correct remaining budget.
|
|
1809
|
+
serialize(adapterCliKey(adapter), () => {
|
|
1810
|
+
const remaining = Math.max(1, overallDeadlineMs - (Date.now() - startedAt));
|
|
1808
1811
|
return raceWithDeadline(
|
|
1809
1812
|
voteFn(role, proposal, adapter, logger11, voteOptions),
|
|
1810
1813
|
role,
|
|
1811
1814
|
remaining
|
|
1812
1815
|
);
|
|
1816
|
+
})
|
|
1817
|
+
);
|
|
1818
|
+
const wrapped = roles.map(async (role, i) => {
|
|
1819
|
+
if (i > 0 && interDelay > 0) await delay(interDelay);
|
|
1820
|
+
const adapter = roleAdapters.get(role) ?? fallbackAdapter;
|
|
1821
|
+
const primary = await voteOnAdapter(role, adapter);
|
|
1822
|
+
if (!shouldRetryOnFallback(primary, adapter, fallbackAdapter)) return primary;
|
|
1823
|
+
logger11.warn("Voter failed on diverse adapter; retrying on fallback (#3587)", {
|
|
1824
|
+
role,
|
|
1825
|
+
failedCli: adapterCliKey(adapter),
|
|
1826
|
+
fallbackCli: adapterCliKey(fallbackAdapter),
|
|
1827
|
+
error: primary.error
|
|
1813
1828
|
});
|
|
1829
|
+
return voteOnAdapter(role, fallbackAdapter);
|
|
1814
1830
|
});
|
|
1815
1831
|
const results = await Promise.all(wrapped);
|
|
1816
1832
|
const expired = results.filter((r) => r.source === "error" && r.error === DEADLINE_MESSAGE);
|
|
@@ -5164,6 +5180,10 @@ function mapOutcomeToDecision(outcome) {
|
|
|
5164
5180
|
return "pending";
|
|
5165
5181
|
}
|
|
5166
5182
|
}
|
|
5183
|
+
function panelDegradationWarning(errorCount, total) {
|
|
5184
|
+
if (errorCount <= 0 || errorCount >= total) return void 0;
|
|
5185
|
+
return `Panel degraded: ${String(errorCount)} of ${String(total)} voters errored; decision rests on ${String(total - errorCount)} voter(s).`;
|
|
5186
|
+
}
|
|
5167
5187
|
function buildResponse(input, result) {
|
|
5168
5188
|
const proposalTruncated = input.proposal.length > 200 ? input.proposal.slice(0, 200) + "..." : input.proposal;
|
|
5169
5189
|
const errorCount = result.votes.filter((v) => v.source === "error").length;
|
|
@@ -5190,20 +5210,27 @@ function buildResponse(input, result) {
|
|
|
5190
5210
|
if (result.policyReason !== void 0) {
|
|
5191
5211
|
response.policyReason = result.policyReason;
|
|
5192
5212
|
}
|
|
5213
|
+
const panelWarning = panelDegradationWarning(errorCount, result.votes.length);
|
|
5214
|
+
if (panelWarning !== void 0) {
|
|
5215
|
+
response.panelWarning = panelWarning;
|
|
5216
|
+
}
|
|
5193
5217
|
if (isHigherOrderStrategy(result.strategy) && result.higherOrderResult) {
|
|
5194
|
-
response.higherOrderMetadata =
|
|
5195
|
-
posteriorApproval: result.higherOrderResult.posteriorApproval,
|
|
5196
|
-
posteriorRejection: result.higherOrderResult.posteriorRejection,
|
|
5197
|
-
effectiveVoteCount: result.higherOrderResult.effectiveVoteCount,
|
|
5198
|
-
method: result.higherOrderResult.method,
|
|
5199
|
-
usedCorrelationData: result.higherOrderResult.usedCorrelationData,
|
|
5200
|
-
improvementOverBaseline: result.higherOrderResult.improvementOverBaseline,
|
|
5201
|
-
downweightedAgents: result.higherOrderResult.downweightedAgents,
|
|
5202
|
-
reasoning: result.higherOrderResult.reasoning
|
|
5203
|
-
};
|
|
5218
|
+
response.higherOrderMetadata = toHigherOrderMetadata(result.higherOrderResult);
|
|
5204
5219
|
}
|
|
5205
5220
|
return response;
|
|
5206
5221
|
}
|
|
5222
|
+
function toHigherOrderMetadata(r) {
|
|
5223
|
+
return {
|
|
5224
|
+
posteriorApproval: r.posteriorApproval,
|
|
5225
|
+
posteriorRejection: r.posteriorRejection,
|
|
5226
|
+
effectiveVoteCount: r.effectiveVoteCount,
|
|
5227
|
+
method: r.method,
|
|
5228
|
+
usedCorrelationData: r.usedCorrelationData,
|
|
5229
|
+
improvementOverBaseline: r.improvementOverBaseline,
|
|
5230
|
+
downweightedAgents: r.downweightedAgents,
|
|
5231
|
+
reasoning: r.reasoning
|
|
5232
|
+
};
|
|
5233
|
+
}
|
|
5207
5234
|
|
|
5208
5235
|
// src/mcp/tools/consensus-vote-error-policy.ts
|
|
5209
5236
|
function isHardFloorTripped(errorCount, totalCount) {
|
|
@@ -6476,4 +6503,4 @@ export {
|
|
|
6476
6503
|
CONSENSUS_VOTE_OUTPUT_SCHEMA,
|
|
6477
6504
|
registerConsensusVoteTool
|
|
6478
6505
|
};
|
|
6479
|
-
//# sourceMappingURL=chunk-
|
|
6506
|
+
//# sourceMappingURL=chunk-NPRLDYPV.js.map
|