@wjarka/cezarion 0.17.0-pr2007.3051 → 0.17.0-pr2007.3052.2

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.
@@ -1,4 +1,5 @@
1
1
  import { reservedReplies } from '../delegation/questions.js';
2
+ import { inboxSlotsUsed } from '../delegation/conversations.js';
2
3
  /** The first fallback reason, or the conversation that admitted the worker question. */
3
4
  export function workerQuestionFallback(worker, root, parentCanReceive) {
4
5
  // Recovery can find a question that never left a worker which has since stopped.
@@ -9,7 +10,8 @@ export function workerQuestionFallback(worker, root, parentCanReceive) {
9
10
  const state = root.delegation.conversation ?? { messages: [], outcomes: [] };
10
11
  // Room in the ledger for the question AND its reply, beside the replies other open requests
11
12
  // reserve. The reply itself is always admitted to this worker's inbox (service.send).
12
- if (state.messages.length + reservedReplies(state) + 2 > 1024 || (root.agentInputs ?? []).filter(input => !input.deliveredAt).length >= 32 ||
13
+ // The parent's inbox slots count those its open peer requests hold for their replies.
14
+ if (state.messages.length + reservedReplies(state) + 2 > 1024 || inboxSlotsUsed(root) >= 32 ||
13
15
  state.messages.filter(m => m.kind === 'request' && m.state === 'accepted' && !state.outcomes.some(o => o.requestId === m.id)).length >= 32) {
14
16
  return { reason: 'the parent conversation is at capacity' };
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"question-routing.js","sourceRoot":"","sources":["../../src/workflows/question-routing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wFAAwF;AACxF,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,IAA2B,EAAE,gBAA8C;IACnI,iFAAiF;IACjF,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACnG,IAAI,IAAI,EAAE,UAAU,EA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AS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACnG,IAAI,IAAI,EAAE,UAAU,EAAE,IAAI,KAAK,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC;IACjI,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC7E,4FAA4F;IAC5F,sFAAsF;IACtF,sFAAsF;IACtF,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE;QACzF,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC7I,OAAO,EAAE,MAAM,EAAE,wCAAwC,EAAE,CAAC;IAC9D,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC"}
@@ -74,7 +74,7 @@ import { enqueueAgentInput, agentInputBatch, hasLiveInboxClaim } from '../delega
74
74
  import { parseDelegationEffort } from '../delegation/effort.js';
75
75
  import { DelegationPolicyError } from '../delegation/policy.js';
76
76
  import { reconcileWorkerEntry } from '../delegation/wait.js';
77
- import { commitNewMessage, reconcileConversationState, projectConversationEvents, rootsAwaitingPeer, settledRunFamilies } from '../delegation/conversations.js';
77
+ import { commitNewMessage, inboxSlotsUsed, reconcileConversationState, projectConversationEvents, rootsAwaitingPeer, settledRunFamilies } from '../delegation/conversations.js';
78
78
  import { parentReadiness } from '../delegation/readiness.js';
79
79
  import { answersQuestion, questionMessage, reservedReplies } from '../delegation/questions.js';
80
80
  import { workerQuestionFallback } from './question-routing.js';
@@ -5371,7 +5371,7 @@ export class RunManager {
5371
5371
  /** The ledger and the parent's inbox keep room as `service.send` counts it, beside open
5372
5372
  * questions' replies. When either is full, the worker's log says so once per wait. */
5373
5373
  parkNoticeAtCapacity(workerId, waitId, root, state) {
5374
- if (state.messages.length + reservedReplies(state) < 1024 && (root.agentInputs ?? []).filter(input => !input.deliveredAt).length < 32)
5374
+ if (state.messages.length + reservedReplies(state) < 1024 && inboxSlotsUsed(root) < 32)
5375
5375
  return false;
5376
5376
  const projectionId = `park-notice-skipped:${waitId}`;
5377
5377
  if (!this.store.hasProjection(workerId, projectionId)) {