@respan/cli 0.6.7 → 0.6.8

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.
@@ -664,6 +664,8 @@ function processBeforeTool(hookData) {
664
664
  const pending = state.pending_tools ?? [];
665
665
  pending.push({ name: toolName, input: toolInput, start_time: nowISO() });
666
666
  state.pending_tools = pending;
667
+ state.send_version = (state.send_version ?? 0) + 1;
668
+ state.tool_turns = (state.tool_turns ?? 0) + 1;
667
669
  saveStreamState(sessionId, state);
668
670
  }
669
671
  function processAfterTool(hookData) {
@@ -387,6 +387,10 @@ function processBeforeTool(hookData) {
387
387
  const pending = state.pending_tools ?? [];
388
388
  pending.push({ name: toolName, input: toolInput, start_time: nowISO() });
389
389
  state.pending_tools = pending;
390
+ // Increment send_version to cancel any pending delayed sends —
391
+ // the turn isn't done yet, a tool is about to execute.
392
+ state.send_version = (state.send_version ?? 0) + 1;
393
+ state.tool_turns = (state.tool_turns ?? 0) + 1;
390
394
  saveStreamState(sessionId, state);
391
395
  }
392
396
  function processAfterTool(hookData) {