@genesislcap/ai-assistant 15.85.0 → 15.85.1

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.
@@ -10255,7 +10255,8 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
10255
10255
  *
10256
10256
  * A failed call ends the turn there, as a Stop does: what it asked for still happens, and the
10257
10257
  * next agent runs on the next message. Running it now would meet the same wall (a budget, a
10258
- * refused account, a full context window), or build on a reply that never came.
10258
+ * refused account, a full context window), or build on a reply that never came. The one thing a
10259
+ * Stop takes back is a hand-off that has not started (see `afterAgentCall`).
10259
10260
  */
10260
10261
  async carryOn(result) {
10261
10262
  let last = result;
@@ -10273,10 +10274,18 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
10273
10274
  *
10274
10275
  * A plain target hands back when its call ends, released or not, as a plain agent is done once
10275
10276
  * it has answered. A stateful one holds the hand-off until it releases, as it holds its flow.
10277
+ *
10278
+ * A Stop cancels a hand-off that has not started: the user stopped the turn the caller asked for
10279
+ * it in, often during the caller's closing call, so the target is not activated, and the call
10280
+ * ends as if it had never asked (a plain caller's turn ends as usual below). A hand-back is not
10281
+ * taken back: the target finished the work it was given.
10276
10282
  */
10277
10283
  async afterAgentCall() {
10278
10284
  const request = this.chatDriver.getHandOffRequest();
10279
- if (request) return this.startHandOff(request);
10285
+ if (request && !this.cancelled) return this.startHandOff(request);
10286
+ if (request) {
10287
+ logger2.debug(`OrchestratingDriver: stopped before the hand-off to "${request.to}" started`);
10288
+ }
10280
10289
  const active = this.agentSession.getActive();
10281
10290
  if (!active) return void 0;
10282
10291
  const frame = this.topFrameFor(active.name);