@dreb/coding-agent 2.25.1 → 2.25.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.
@@ -441,11 +441,8 @@ export class InteractiveMode {
441
441
  this.initTabTitleGenerator();
442
442
  // Subscribe to agent events
443
443
  this.subscribeToAgent();
444
- // Auto-load buddy if one exists
445
- const existingBuddy = this.buddyController.start();
446
- if (existingBuddy) {
447
- this.mountBuddy(existingBuddy);
448
- }
444
+ // Auto-load buddy if one exists (skips visual mount when hidden via /buddy off).
445
+ this.mountExistingBuddyIfVisible();
449
446
  // Set up theme file watcher
450
447
  onThemeChange(() => {
451
448
  this.ui.invalidate();
@@ -4365,6 +4362,19 @@ ${cycleModelForward || cycleModelBackward ? `| \`${cycleModelForward}\` / \`${cy
4365
4362
  this.showBuddyStatsPanel(state);
4366
4363
  await this.checkAndWarnOllama();
4367
4364
  }
4365
+ /**
4366
+ * Load the persisted buddy at startup and mount it only if it is visible.
4367
+ * A buddy hidden via `/buddy off` is still loaded by start() (disabled) so
4368
+ * context/idle wiring stays intact, but it must not be re-mounted on screen
4369
+ * in a new session — that is the regression fixed for #243. Extracted into a
4370
+ * standalone method so the mount-gate decision is directly unit-testable.
4371
+ */
4372
+ mountExistingBuddyIfVisible() {
4373
+ const existingBuddy = this.buddyController.start();
4374
+ if (existingBuddy && !existingBuddy.hidden) {
4375
+ this.mountBuddy(existingBuddy);
4376
+ }
4377
+ }
4368
4378
  mountBuddy(state) {
4369
4379
  // Remove existing if any
4370
4380
  this.removeBuddy();