negotium 0.21.3 → 0.22.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.
@@ -5199,7 +5199,7 @@ var init_codex = __esm(async () => {
5199
5199
  });
5200
5200
 
5201
5201
  // ../../packages/core/src/version.ts
5202
- var NEGOTIUM_VERSION = "0.21.3";
5202
+ var NEGOTIUM_VERSION = "0.22.0";
5203
5203
 
5204
5204
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
5205
5205
  import { spawn as spawn2 } from "child_process";
@@ -10999,8 +10999,20 @@ class InterSessionQueue {
10999
10999
  keysForRoom() {
11000
11000
  return Array.from(this.queue.keys());
11001
11001
  }
11002
- drop(topicId) {
11002
+ drop(topicId, reason = "target session was stopped before the request ran") {
11003
+ const bucket = this.queue.get(topicId);
11003
11004
  this.queue.delete(topicId);
11005
+ if (!bucket)
11006
+ return 0;
11007
+ const dropped = bucket.items.slice(bucket.head);
11008
+ for (const inject of dropped) {
11009
+ try {
11010
+ inject.onSettled?.({ queryId: "", kind: "error", error: reason });
11011
+ } catch (err) {
11012
+ logger.warn({ err, topicId, requestId: inject.requestId }, "session inject drop settlement hook failed");
11013
+ }
11014
+ }
11015
+ return dropped.length;
11004
11016
  }
11005
11017
  size(topicId) {
11006
11018
  const bucket = this.queue.get(topicId);
@@ -20684,9 +20696,8 @@ function startAiTurn(params) {
20684
20696
  contextWindow: outcome.usage.contextWindow
20685
20697
  } : undefined, { agent: agentKind, model: resolvedModel, budgetReason: outcome.reason });
20686
20698
  WsHub.get().broadcastTopicNotice(topicId, "warning", "\uC608\uC0B0 \uD55C\uB3C4 \uB3C4\uB2EC");
20687
- } else {
20688
- await deliverAskError(queryId, topic.title, error);
20689
20699
  }
20700
+ await deliverAskError(queryId, topic.title, error);
20690
20701
  await settleSubagentFailure(queryId, error);
20691
20702
  try {
20692
20703
  onSettled?.({ queryId, kind: "error", error });
@@ -20731,6 +20742,7 @@ function startAiTurn(params) {
20731
20742
  WsHub.get().broadcastError(topicId, queryId, error);
20732
20743
  WsHub.get().broadcastTopicNotice(topicId, "error", "\uC751\uB2F5 \uC2E4\uD328");
20733
20744
  }
20745
+ await deliverAskError(queryId, topic.title, error);
20734
20746
  await settleSubagentFailure(queryId, classifyAgentError(error, agentKind));
20735
20747
  try {
20736
20748
  onSettled?.({
@@ -22827,4 +22839,4 @@ export {
22827
22839
  DEFAULT_SELF_CONFIG_PRODUCT
22828
22840
  };
22829
22841
 
22830
- //# debugId=10C6EC28EC08FE1364756E2164756E21
22842
+ //# debugId=15A62BAA7CA7894C64756E2164756E21