@averyyy/pi-coding-agent 0.82.1-piclient.1 → 0.82.1-piclient.3

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.
@@ -16,7 +16,6 @@ import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, }
16
16
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
17
17
  import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
18
18
  import { KeybindingsManager } from "../../core/keybindings.js";
19
- import { createCompactionSummaryMessage } from "../../core/messages.js";
20
19
  import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScope, resolveModelScopeWithDiagnostics, } from "../../core/model-resolver.js";
21
20
  import { DefaultPackageManager } from "../../core/package-manager.js";
22
21
  import { getPiClientUpdateMarkerPath, PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE, readPiClientUpdateMarker, writePiClientRuntimeReloadState, } from "../../core/pi-client-runtime-update.js";
@@ -1447,6 +1446,15 @@ export class InteractiveMode {
1447
1446
  }
1448
1447
  this.ui.requestRender();
1449
1448
  }
1449
+ restoreWorkingIndicator() {
1450
+ if (!this.session.isStreaming || !this.workingVisible) {
1451
+ return;
1452
+ }
1453
+ if (this.settingsManager.getShowTerminalProgress()) {
1454
+ this.ui.terminal.setProgress(true);
1455
+ }
1456
+ this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
1457
+ }
1450
1458
  setHiddenThinkingLabel(label) {
1451
1459
  this.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;
1452
1460
  for (const child of this.chatContainer.children) {
@@ -2452,10 +2460,6 @@ export class InteractiveMode {
2452
2460
  break;
2453
2461
  }
2454
2462
  case "agent_end":
2455
- if (this.settingsManager.getShowTerminalProgress()) {
2456
- this.ui.terminal.setProgress(false);
2457
- }
2458
- this.clearStatusIndicator("working");
2459
2463
  if (this.streamingComponent) {
2460
2464
  this.chatContainer.removeChild(this.streamingComponent);
2461
2465
  this.streamingComponent = undefined;
@@ -2465,7 +2469,12 @@ export class InteractiveMode {
2465
2469
  this.ui.requestRender();
2466
2470
  break;
2467
2471
  case "agent_settled":
2472
+ if (this.settingsManager.getShowTerminalProgress()) {
2473
+ this.ui.terminal.setProgress(false);
2474
+ }
2475
+ this.clearStatusIndicator("working");
2468
2476
  await this.checkShutdownRequested();
2477
+ this.ui.requestRender();
2469
2478
  break;
2470
2479
  case "compaction_start": {
2471
2480
  if (this.settingsManager.getShowTerminalProgress()) {
@@ -2498,9 +2507,7 @@ export class InteractiveMode {
2498
2507
  }
2499
2508
  }
2500
2509
  else if (event.result) {
2501
- this.chatContainer.clear();
2502
2510
  this.rebuildChatFromMessages();
2503
- this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
2504
2511
  this.footer.invalidate();
2505
2512
  }
2506
2513
  else if (event.errorMessage) {
@@ -2512,6 +2519,7 @@ export class InteractiveMode {
2512
2519
  this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
2513
2520
  }
2514
2521
  }
2522
+ this.restoreWorkingIndicator();
2515
2523
  void this.flushCompactionQueue({ willRetry: event.willRetry });
2516
2524
  this.ui.requestRender();
2517
2525
  break;
@@ -2537,6 +2545,7 @@ export class InteractiveMode {
2537
2545
  if (!event.success) {
2538
2546
  this.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || "Unknown error"}`);
2539
2547
  }
2548
+ this.restoreWorkingIndicator();
2540
2549
  this.ui.requestRender();
2541
2550
  break;
2542
2551
  }
@@ -2766,8 +2775,8 @@ export class InteractiveMode {
2766
2775
  this.ui.requestRender();
2767
2776
  }
2768
2777
  /**
2769
- * Render session entries to chat. Used for initial load and rebuild after compaction.
2770
- * @param entries Compaction-aware session entries to render
2778
+ * Render session entries to chat. Used for initial load and transcript rebuilds.
2779
+ * @param entries Active-branch session entries to render
2771
2780
  * @param options.updateFooter Update footer state
2772
2781
  * @param options.populateHistory Add user messages to editor history
2773
2782
  */
@@ -2810,7 +2819,7 @@ export class InteractiveMode {
2810
2819
  this.chatContainer.addChild(new Text(text, 1, 0));
2811
2820
  }
2812
2821
  renderInitialMessages() {
2813
- const entries = this.sessionManager.buildContextEntries();
2822
+ const entries = this.sessionManager.getBranch();
2814
2823
  this.renderSessionEntries(entries, {
2815
2824
  updateFooter: true,
2816
2825
  populateHistory: true,
@@ -2847,7 +2856,7 @@ export class InteractiveMode {
2847
2856
  }
2848
2857
  rebuildChatFromMessages() {
2849
2858
  this.chatContainer.clear();
2850
- this.renderSessionEntries(this.sessionManager.buildContextEntries());
2859
+ this.renderSessionEntries(this.sessionManager.getBranch());
2851
2860
  }
2852
2861
  // =========================================================================
2853
2862
  // Key handlers