nexus-agents 2.123.2 → 2.123.4

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.
@@ -40,7 +40,7 @@ import {
40
40
  } from "./chunk-CH7QIDHQ.js";
41
41
 
42
42
  // src/version.ts
43
- var VERSION = true ? "2.123.2" : "dev";
43
+ var VERSION = true ? "2.123.4" : "dev";
44
44
 
45
45
  // src/config/schemas-core.ts
46
46
  import { z } from "zod";
@@ -2099,7 +2099,7 @@ async function runDoctorFix(result) {
2099
2099
  writeLine2("\u2500".repeat(40));
2100
2100
  let fixCount = 0;
2101
2101
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2102
- const { runSetup } = await import("./setup-command-U7XINKI2.js");
2102
+ const { runSetup } = await import("./setup-command-DDDSYC4T.js");
2103
2103
  const setupResult = runSetup({
2104
2104
  skipMcp: true,
2105
2105
  skipRules: true,
@@ -2211,4 +2211,4 @@ export {
2211
2211
  startStdioServer,
2212
2212
  closeServer
2213
2213
  };
2214
- //# sourceMappingURL=chunk-GNTB4CSR.js.map
2214
+ //# sourceMappingURL=chunk-HZDENKIO.js.map
@@ -8,7 +8,7 @@ import {
8
8
  checkSqlite,
9
9
  defaultConfig,
10
10
  initDataDirectories
11
- } from "./chunk-GNTB4CSR.js";
11
+ } from "./chunk-HZDENKIO.js";
12
12
  import {
13
13
  probeAllClis
14
14
  } from "./chunk-TSAEDXVB.js";
@@ -2000,4 +2000,4 @@ export {
2000
2000
  setupCommand,
2001
2001
  setupCommandAsync
2002
2002
  };
2003
- //# sourceMappingURL=chunk-FTZXJXCO.js.map
2003
+ //# sourceMappingURL=chunk-I4HSPTRB.js.map
@@ -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 wrapped = roles.map(async (role, i) => {
1803
- if (i > 0 && interDelay > 0) await delay(interDelay);
1804
- const adapter = roleAdapters.get(role) ?? fallbackAdapter;
1805
- return serialize(adapterCliKey(adapter), () => {
1806
- const elapsed = Date.now() - startedAt;
1807
- const remaining = Math.max(1, overallDeadlineMs - elapsed);
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-SHGWPSEJ.js.map
6506
+ //# sourceMappingURL=chunk-NPRLDYPV.js.map