pi-bro 0.23.1 → 0.24.0

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.
package/src/doctor.ts CHANGED
@@ -10,8 +10,9 @@ import {
10
10
  readAdvisorSteering,
11
11
  resolveAdvisorState,
12
12
  } from "./advisor.ts";
13
- import { agyFailureMessage, reviewBackendError } from "./backend.ts";
13
+ import { agyFailureMessage, reviewBackendNotice } from "./backend.ts";
14
14
  import { createConfigModal } from "./config-ui.ts";
15
+ import { openBroOverlay } from "./modal-kit.ts";
15
16
  import {
16
17
  type AgyEffort,
17
18
  type AgyModelFamily,
@@ -399,15 +400,19 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
399
400
  const override = capabilityOverride(settings, capability);
400
401
  const backend = capabilityBackend(settings, capability);
401
402
  const pair = capabilityPair(settings, capability);
402
- const reviewError = capability === "review" ? reviewBackendError(backend) : undefined;
403
- if (reviewError) { lines.push(`- ℹ **${label}:** needs a Claude or Muse override in \`/bro config\` for model calls; saved reviews remain readable.`); continue; }
403
+ // Review on a shell-capable sandbox is informational, never a failure: report the capability
404
+ // normally, then append one advisory line. Every branch below goes through here.
405
+ const reviewNotice = capability === "review" ? reviewBackendNotice(backend) : undefined;
406
+ const passCapability = (detail: string) => {
407
+ pass(label, detail);
408
+ if (reviewNotice) lines.push(`- ℹ **${label}:** ${reviewNotice}`);
409
+ };
404
410
  if (backend === "claude") {
405
411
  if (!isClaudeEffort(pair.effort)) {
406
412
  fail(label, `\`${pair.effort}\` is unsupported for claude \`${pair.model}\`. Run \`/bro config\` to fix this.`);
407
413
  continue;
408
414
  }
409
- pass(
410
- label,
415
+ passCapability(
411
416
  override
412
417
  ? `override claude \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
413
418
  : `claude \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
@@ -419,8 +424,7 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
419
424
  fail(label, `\`${pair.effort}\` is unsupported for grok \`${pair.model}\`. Run \`/bro config\` to fix this.`);
420
425
  continue;
421
426
  }
422
- pass(
423
- label,
427
+ passCapability(
424
428
  override
425
429
  ? `override grok \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
426
430
  : `grok \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
@@ -432,8 +436,7 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
432
436
  fail(label, `\`${pair.effort}\` is unsupported for codex \`${pair.model}\`. Run \`/bro config\` to fix this.`);
433
437
  continue;
434
438
  }
435
- pass(
436
- label,
439
+ passCapability(
437
440
  override
438
441
  ? `override codex \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
439
442
  : `codex \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
@@ -445,15 +448,19 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
445
448
  fail(label, `\`${pair.effort}\` is unsupported for muse \`${pair.model}\`. Run \`/bro config\` to fix this.`);
446
449
  continue;
447
450
  }
448
- pass(
449
- label,
451
+ passCapability(
450
452
  override
451
453
  ? `override muse \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
452
454
  : `muse \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
453
455
  );
454
456
  continue;
455
457
  }
456
- if (!models) continue;
458
+ // No Agy catalog available: the Agy branch above is the only one that gets here, so there is
459
+ // nothing to validate, but a shell-capable review override still deserves its advisory.
460
+ if (!models) {
461
+ if (reviewNotice) lines.push(`- ℹ **${label}:** ${reviewNotice}`);
462
+ continue;
463
+ }
457
464
  const resolved = resolveCapabilitySettings(settings, capability, models);
458
465
  if (!resolved.family) {
459
466
  fail(label, `\`${resolved.pair.model}\` is unavailable. Run \`/bro config\` to fix this override.`);
@@ -466,8 +473,7 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
466
473
  fail(label, `\`${resolved.pair.effort}\` is unsupported for \`${resolved.family.id}\`. Run \`/bro config\` to fix this.`);
467
474
  continue;
468
475
  }
469
- pass(
470
- label,
476
+ passCapability(
471
477
  override
472
478
  ? `override agy \`${resolved.family.id}\`${resolved.pair.effort === "default" ? "" : ` (${resolved.pair.effort})`}`
473
479
  : "using the shared default",
@@ -528,14 +534,5 @@ export async function showBroConfigModal(ctx: ExtensionCommandContext, pi: Exten
528
534
  families = [];
529
535
  ctx.ui.notify("Agy model catalog unavailable — showing other backend settings without Agy choices.", "warning");
530
536
  }
531
- await ctx.ui.custom<void>(createConfigModal(settings, families, writeSettings), {
532
- overlay: true,
533
- overlayOptions: {
534
- width: "78%",
535
- minWidth: 48,
536
- maxHeight: "78%",
537
- anchor: "top-center",
538
- margin: { top: 1, left: 2, right: 2 },
539
- },
540
- });
537
+ await openBroOverlay<void>(ctx, createConfigModal(settings, families, writeSettings));
541
538
  }