nexus-agents 2.142.1 → 2.144.0

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.
@@ -18,12 +18,13 @@ import {
18
18
  DEFAULT_TASK_TTL_MS,
19
19
  DEFAULT_TOOL_RATE_LIMITS,
20
20
  clampTaskTtl
21
- } from "./chunk-VCLL7WH3.js";
21
+ } from "./chunk-VY2BQT72.js";
22
22
  import {
23
23
  executeExpert
24
24
  } from "./chunk-YJROHCFY.js";
25
25
  import {
26
26
  JobStatusSchema,
27
+ abortJob,
27
28
  collectRealVotes,
28
29
  defaultBusyEnvelope,
29
30
  defaultCollisionEnvelope,
@@ -40,7 +41,7 @@ import {
40
41
  toJobSummary,
41
42
  warnIfSimulatedOutsideTests,
42
43
  writeJobCancelled
43
- } from "./chunk-FPIAD37H.js";
44
+ } from "./chunk-QKWS3REM.js";
44
45
  import {
45
46
  normalizeTopicToCanonical,
46
47
  synthesizeResearch
@@ -39951,39 +39952,44 @@ function cancelJobHandler(args) {
39951
39952
  const { jobId, reason } = parsed.data;
39952
39953
  const existing = readJobResult(jobId);
39953
39954
  if (existing === null) {
39954
- const response2 = {
39955
+ const response = {
39955
39956
  jobId,
39956
39957
  outcome: "unknown_job",
39957
39958
  message: `No job record found for jobId "${jobId}". The job may never have been dispatched, or the sidecar file is unreadable.`
39958
39959
  };
39959
- return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
39960
+ return Promise.resolve(toolSuccess(JSON.stringify(response, null, 2)));
39960
39961
  }
39961
39962
  if (existing.status === "complete" || existing.status === "failed") {
39962
- const response2 = {
39963
+ const response = {
39963
39964
  jobId,
39964
39965
  outcome: "already_complete",
39965
39966
  status: existing.status,
39966
39967
  message: `Job already terminated with status "${existing.status}" \u2014 cancel is a no-op.`
39967
39968
  };
39968
- return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
39969
+ return Promise.resolve(toolSuccess(JSON.stringify(response, null, 2)));
39969
39970
  }
39970
39971
  if (existing.status === "cancelled") {
39971
- const response2 = {
39972
+ const response = {
39972
39973
  jobId,
39973
39974
  outcome: "already_cancelled",
39974
39975
  status: "cancelled",
39975
39976
  message: "Job is already cancelled \u2014 second cancel is an idempotent no-op."
39976
39977
  };
39977
- return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
39978
+ return Promise.resolve(toolSuccess(JSON.stringify(response, null, 2)));
39978
39979
  }
39979
- writeJobCancelled(jobId, existing.toolName, reason);
39980
- const response = {
39980
+ return Promise.resolve(
39981
+ toolSuccess(JSON.stringify(cancelPendingJob(jobId, existing.toolName, reason), null, 2))
39982
+ );
39983
+ }
39984
+ function cancelPendingJob(jobId, toolName, reason) {
39985
+ writeJobCancelled(jobId, toolName, reason);
39986
+ const aborted = abortJob(jobId, reason);
39987
+ return {
39981
39988
  jobId,
39982
39989
  outcome: "cancelled",
39983
39990
  status: "cancelled",
39984
- message: `Job ${jobId} marked cancelled. In-flight work in the dispatching process aborts via AbortSignal; cross-process workers need to poll get_job_result to observe.`
39991
+ message: `Job ${jobId} marked cancelled. ` + (aborted ? "Its in-flight AbortSignal was fired \u2014 work that threads the signal stops in this process; " : "No in-flight controller was registered (the job already settled or runs in another process); ") + "cross-process workers need to poll get_job_result to observe."
39985
39992
  };
39986
- return Promise.resolve(toolSuccess(JSON.stringify(response, null, 2)));
39987
39993
  }
39988
39994
  function registerCancelJobTool(server, deps) {
39989
39995
  const logger58 = deps.logger ?? createLogger({ tool: "cancel_job" });
@@ -43401,7 +43407,7 @@ ${contextBlock}`;
43401
43407
  const strategy = config.votingStrategy ?? "higher_order";
43402
43408
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43403
43409
  try {
43404
- const { executeVoting } = await import("./consensus-vote-DYE7UKAI.js");
43410
+ const { executeVoting } = await import("./consensus-vote-6V3JNRXI.js");
43405
43411
  const votingResult = await executeVoting(
43406
43412
  {
43407
43413
  proposal: buildVoteProposal(plan, research),
@@ -51183,4 +51189,4 @@ export {
51183
51189
  shutdownFeedbackSubscriber,
51184
51190
  createEventBusBridge
51185
51191
  };
51186
- //# sourceMappingURL=chunk-PH5DWWK6.js.map
51192
+ //# sourceMappingURL=chunk-CMFV3Y47.js.map