@caupulican/pi-adaptative 0.80.15 → 0.80.16

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.
@@ -1567,12 +1567,13 @@ export class InteractiveMode {
1567
1567
  attachToolExecutionComponent(toolName, toolCallId, args) {
1568
1568
  const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
1569
1569
  const toolDefinition = this.getRegisteredToolDefinition(toolName);
1570
- const existing = this.toolPanels.getReusable(actionKey);
1570
+ const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
1571
+ const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
1571
1572
  if (existing) {
1572
- if (shouldReuseToolPanelInPlace(toolName, args)) {
1573
+ if (reuseInPlace && actionKey) {
1573
1574
  existing.resetInvocation(toolName, toolCallId, args, toolDefinition);
1574
1575
  existing.setExpanded(this.toolOutputExpanded);
1575
- this.toolPanels.register(toolCallId, existing, actionKey);
1576
+ this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
1576
1577
  this.ui.requestRender();
1577
1578
  return existing;
1578
1579
  }
@@ -3545,8 +3546,13 @@ export class InteractiveMode {
3545
3546
  for (const message of preCommands) {
3546
3547
  await this.session.prompt(message.text);
3547
3548
  }
3548
- // Send first prompt (starts streaming)
3549
- const promptPromise = this.session.prompt(firstPrompt.text, { images: firstPrompt.images }).catch((error) => {
3549
+ // Send first prompt (starts streaming). Auto-compaction can finish while the
3550
+ // agent is still processing; in that case, queue the message with the same
3551
+ // steering/follow-up mode instead of surfacing an internal streamingBehavior error.
3552
+ const promptOptions = this.session.isStreaming
3553
+ ? { images: firstPrompt.images, streamingBehavior: firstPrompt.mode }
3554
+ : { images: firstPrompt.images };
3555
+ const promptPromise = this.session.prompt(firstPrompt.text, promptOptions).catch((error) => {
3550
3556
  restoreQueue(error);
3551
3557
  });
3552
3558
  // Queue remaining messages