pi-bro 0.34.0 → 0.35.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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/docs/overthink.md +22 -4
- package/docs/reference/commands.md +1 -1
- package/package.json +2 -2
- package/src/backend.ts +247 -332
- package/src/bro.ts +9 -2
- package/src/btw.ts +4 -17
- package/src/doctor.ts +79 -234
- package/src/grill.ts +64 -76
- package/src/overthink-questions-ui.ts +3 -3
- package/src/overthink-state.ts +80 -17
- package/src/overthink.ts +84 -33
- package/src/remember-store.ts +13 -7
- package/src/remember.ts +2 -8
- package/src/review-ui.ts +31 -9
package/src/bro.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolveBtwThread,
|
|
9
9
|
} from "./btw.ts";
|
|
10
10
|
import { doctorReport, showBroConfigModal } from "./doctor.ts";
|
|
11
|
-
import { setPiHostContext } from "./backend.ts";
|
|
11
|
+
import { setPiHostContext, stopActiveBackendExecutions } from "./backend.ts";
|
|
12
12
|
import { openElevateModal } from "./elevate.ts";
|
|
13
13
|
import { openArchitectureDocs } from "./architecture.ts";
|
|
14
14
|
import { openGrillModal } from "./grill.ts";
|
|
@@ -154,7 +154,14 @@ export default async function bro(pi: ExtensionAPI) {
|
|
|
154
154
|
grillThread = restored.grill;
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
pi.on("session_shutdown", async () => {
|
|
157
|
+
pi.on("session_shutdown", async () => {
|
|
158
|
+
// Both cleanups begin before we await either one.
|
|
159
|
+
const [reviews, backends] = await Promise.allSettled([
|
|
160
|
+
stopGuidedReviews(), stopActiveBackendExecutions(),
|
|
161
|
+
]);
|
|
162
|
+
if (reviews.status === "rejected") throw reviews.reason;
|
|
163
|
+
if (backends.status === "rejected") throw backends.reason;
|
|
164
|
+
});
|
|
158
165
|
pi.on("session_start", async (_event, ctx) => { restore(ctx); });
|
|
159
166
|
pi.on("session_tree", async (_event, ctx) => { restore(ctx); });
|
|
160
167
|
|
package/src/btw.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { copyToClipboard, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { Input, Markdown, matchesKey, wrapTextWithAnsi, type Focusable } from "@earendil-works/pi-tui";
|
|
4
|
-
import { execute as executeBackend,
|
|
4
|
+
import { execute as executeBackend, textProgressThrottle, type BackendSelection } from "./backend.ts";
|
|
5
5
|
import { buildBtwPrompt } from "./prompt.ts";
|
|
6
6
|
import {
|
|
7
7
|
type BackendName,
|
|
@@ -140,20 +140,7 @@ export async function runBtwTurn(
|
|
|
140
140
|
signal: AbortSignal,
|
|
141
141
|
onProgress?: (text: string) => void,
|
|
142
142
|
): Promise<{ text: string; conversationId?: string; expiredContinuation?: true }> {
|
|
143
|
-
|
|
144
|
-
let latest: string | undefined;
|
|
145
|
-
const throttledProgress = onProgress
|
|
146
|
-
? (progress: BackendProgress) => {
|
|
147
|
-
if (progress.kind !== "text") return;
|
|
148
|
-
latest = progress.text;
|
|
149
|
-
if (!updateTimer) {
|
|
150
|
-
updateTimer = setTimeout(() => {
|
|
151
|
-
updateTimer = undefined;
|
|
152
|
-
if (!signal.aborted && latest !== undefined) onProgress(latest);
|
|
153
|
-
}, 75);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
: undefined;
|
|
143
|
+
const progress = textProgressThrottle(signal, onProgress);
|
|
157
144
|
|
|
158
145
|
try {
|
|
159
146
|
const outcome = await executeBackend(
|
|
@@ -166,13 +153,13 @@ export async function runBtwTurn(
|
|
|
166
153
|
},
|
|
167
154
|
selection,
|
|
168
155
|
signal,
|
|
169
|
-
|
|
156
|
+
progress.receive,
|
|
170
157
|
);
|
|
171
158
|
if (outcome.status === "success") return { text: outcome.text, conversationId: outcome.continuation?.id };
|
|
172
159
|
if (outcome.continuationExpired) return { text: "", expiredContinuation: true };
|
|
173
160
|
throw new Error(outcome.message);
|
|
174
161
|
} finally {
|
|
175
|
-
|
|
162
|
+
progress.dispose();
|
|
176
163
|
}
|
|
177
164
|
}
|
|
178
165
|
|
package/src/doctor.ts
CHANGED
|
@@ -33,14 +33,11 @@ import {
|
|
|
33
33
|
CAPABILITIES,
|
|
34
34
|
CAPABILITY_LABELS,
|
|
35
35
|
EFFORTS,
|
|
36
|
+
EXTERNAL_BACKENDS,
|
|
37
|
+
isExternalBackend,
|
|
36
38
|
capabilityBackend,
|
|
37
39
|
capabilityOverride,
|
|
38
40
|
capabilityPair,
|
|
39
|
-
isClaudeEffort,
|
|
40
|
-
isCodexEffort,
|
|
41
|
-
isGrokEffort,
|
|
42
|
-
isMuseEffort,
|
|
43
|
-
isPiEffort,
|
|
44
41
|
readPreferences,
|
|
45
42
|
readSettings,
|
|
46
43
|
resolveCapabilitySettings,
|
|
@@ -102,18 +99,12 @@ export function parseAgyModels(output: string): AgyModelFamily[] {
|
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
export async function listAgyModels(pi: ExtensionAPI, signal?: AbortSignal): Promise<AgyModelFamily[]> {
|
|
105
|
-
const
|
|
102
|
+
const result = await probeCli(pi, "agy", ["models"], signal, 30_000);
|
|
103
|
+
if (result.killed || result.code !== 0) throw new Error(agyFailureMessage("list models", result));
|
|
106
104
|
try {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
return parseAgyModels(result.stdout);
|
|
112
|
-
} catch (error) {
|
|
113
|
-
throw new Error(withDoctor(error));
|
|
114
|
-
}
|
|
115
|
-
} finally {
|
|
116
|
-
await rm(runDirectory, { recursive: true, force: true });
|
|
105
|
+
return parseAgyModels(result.stdout);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
throw new Error(withDoctor(error));
|
|
117
108
|
}
|
|
118
109
|
}
|
|
119
110
|
|
|
@@ -155,20 +146,28 @@ function piEffortDetail(model: Parameters<typeof piEffectiveEffort>[0], effort:
|
|
|
155
146
|
return `${effort} → ${effective} (clamped)`;
|
|
156
147
|
}
|
|
157
148
|
|
|
158
|
-
|
|
149
|
+
// Every diagnostic CLI probe runs away from the user's project and cleans up on all outcomes.
|
|
150
|
+
async function probeCli(
|
|
151
|
+
pi: ExtensionAPI, binary: string, args: string[], signal: AbortSignal | undefined, timeout: number,
|
|
152
|
+
): Promise<Awaited<ReturnType<ExtensionAPI["exec"]>>> {
|
|
159
153
|
const runDirectory = await mkdtemp(join(tmpdir(), "pi-bro-"));
|
|
160
154
|
try {
|
|
161
|
-
const result = await pi.exec(
|
|
162
|
-
if (signal
|
|
163
|
-
|
|
164
|
-
const version = result.stdout.trim() || result.stderr.trim();
|
|
165
|
-
if (!version) throw new Error("Agy returned no version information. Update Agy, then run `/bro doctor` again.");
|
|
166
|
-
return version;
|
|
155
|
+
const result = await pi.exec(binary, args, { cwd: runDirectory, signal, timeout });
|
|
156
|
+
if (signal?.aborted) throw new Error("Canceled.");
|
|
157
|
+
return result;
|
|
167
158
|
} finally {
|
|
168
159
|
await rm(runDirectory, { recursive: true, force: true });
|
|
169
160
|
}
|
|
170
161
|
}
|
|
171
162
|
|
|
163
|
+
async function checkAgyVersion(pi: ExtensionAPI, signal: AbortSignal): Promise<string> {
|
|
164
|
+
const result = await probeCli(pi, "agy", ["--version"], signal, 10_000);
|
|
165
|
+
if (result.killed || result.code !== 0) throw new Error(agyFailureMessage("start", result));
|
|
166
|
+
const version = result.stdout.trim() || result.stderr.trim();
|
|
167
|
+
if (!version) throw new Error("Agy returned no version information. Update Agy, then run `/bro doctor` again.");
|
|
168
|
+
return version;
|
|
169
|
+
}
|
|
170
|
+
|
|
172
171
|
function resolveCatalogSettings(
|
|
173
172
|
settings: BroSettings,
|
|
174
173
|
families: AgyModelFamily[],
|
|
@@ -179,82 +178,54 @@ function resolveCatalogSettings(
|
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
async function checkCliVersion(pi: ExtensionAPI, binary: string, displayName: string, signal: AbortSignal): Promise<string> {
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
? `${displayName} could not start: ${detail}\n\nRun \`/bro doctor\` for setup help.`
|
|
191
|
-
: `${displayName} could not start. Make sure ${displayName} is installed and on PATH, then run \`/bro doctor\`.`,
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
const version = result.stdout.trim() || result.stderr.trim();
|
|
195
|
-
if (!version) throw new Error(`${displayName} returned no version information. Update ${displayName}, then run \`/bro doctor\` again.`);
|
|
196
|
-
return version;
|
|
197
|
-
} finally {
|
|
198
|
-
await rm(runDirectory, { recursive: true, force: true });
|
|
181
|
+
const result = await probeCli(pi, binary, ["--version"], signal, 10_000);
|
|
182
|
+
if (result.killed || result.code !== 0) {
|
|
183
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
184
|
+
throw new Error(
|
|
185
|
+
detail
|
|
186
|
+
? `${displayName} could not start: ${detail}\n\nRun \`/bro doctor\` for setup help.`
|
|
187
|
+
: `${displayName} could not start. Make sure ${displayName} is installed and on PATH, then run \`/bro doctor\`.`,
|
|
188
|
+
);
|
|
199
189
|
}
|
|
190
|
+
const version = result.stdout.trim() || result.stderr.trim();
|
|
191
|
+
if (!version) throw new Error(`${displayName} returned no version information. Update ${displayName}, then run \`/bro doctor\` again.`);
|
|
192
|
+
return version;
|
|
200
193
|
}
|
|
201
194
|
|
|
202
195
|
// Auth status only: a version/auth answer without a model request. A passing answer here
|
|
203
196
|
// says the CLI starts and reports signed-in state -- it does not imply connectivity.
|
|
204
197
|
async function checkClaudeAuth(pi: ExtensionAPI, signal: AbortSignal): Promise<string> {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
if (result.killed || result.code !== 0) {
|
|
210
|
-
const detail = result.stderr.trim() || result.stdout.trim();
|
|
211
|
-
throw new Error(detail ? `Claude auth status: ${detail}` : "Claude auth status is unknown. Sign in, then run `/bro doctor`.");
|
|
212
|
-
}
|
|
213
|
-
let status: unknown;
|
|
214
|
-
try { status = JSON.parse(result.stdout); } catch { throw new Error("Claude returned unreadable auth status; sign in and retry /bro doctor."); }
|
|
215
|
-
if (!isRecord(status) || status.loggedIn !== true) throw new Error("Claude is not signed in. Run `claude auth login`.");
|
|
216
|
-
return "authentication configured (not a connectivity test)";
|
|
217
|
-
} finally {
|
|
218
|
-
await rm(runDirectory, { recursive: true, force: true });
|
|
198
|
+
const result = await probeCli(pi, "claude", ["auth", "status"], signal, 15_000);
|
|
199
|
+
if (result.killed || result.code !== 0) {
|
|
200
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
201
|
+
throw new Error(detail ? `Claude auth status: ${detail}` : "Claude auth status is unknown. Sign in, then run `/bro doctor`.");
|
|
219
202
|
}
|
|
203
|
+
let status: unknown;
|
|
204
|
+
try { status = JSON.parse(result.stdout); } catch { throw new Error("Claude returned unreadable auth status; sign in and retry /bro doctor."); }
|
|
205
|
+
if (!isRecord(status) || status.loggedIn !== true) throw new Error("Claude is not signed in. Run `claude auth login`.");
|
|
206
|
+
return "authentication configured (not a connectivity test)";
|
|
220
207
|
}
|
|
221
208
|
|
|
222
209
|
// Auth status only: a version/auth answer without a model request. A passing answer here
|
|
223
210
|
// says the CLI starts and reports signed-in state -- it does not imply connectivity.
|
|
224
211
|
async function checkCodexAuth(pi: ExtensionAPI, signal: AbortSignal): Promise<string> {
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
if (result.killed || result.code !== 0) {
|
|
230
|
-
const detail = result.stderr.trim() || result.stdout.trim();
|
|
231
|
-
throw new Error(detail ? `Codex auth status: ${detail}` : "Codex is not logged in. Run `codex login`.");
|
|
232
|
-
}
|
|
233
|
-
const status = result.stdout.trim() || result.stderr.trim();
|
|
234
|
-
if (!status || !/logged in/i.test(status)) throw new Error("Codex is not logged in. Run `codex login`.");
|
|
235
|
-
return "authentication configured (not a connectivity test)";
|
|
236
|
-
} finally {
|
|
237
|
-
await rm(runDirectory, { recursive: true, force: true });
|
|
212
|
+
const result = await probeCli(pi, "codex", ["login", "status"], signal, 15_000);
|
|
213
|
+
if (result.killed || result.code !== 0) {
|
|
214
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
215
|
+
throw new Error(detail ? `Codex auth status: ${detail}` : "Codex is not logged in. Run `codex login`.");
|
|
238
216
|
}
|
|
217
|
+
const status = result.stdout.trim() || result.stderr.trim();
|
|
218
|
+
if (!status || !/logged in/i.test(status)) throw new Error("Codex is not logged in. Run `codex login`.");
|
|
219
|
+
return "authentication configured (not a connectivity test)";
|
|
239
220
|
}
|
|
240
221
|
|
|
241
222
|
async function checkAgyUsage(pi: ExtensionAPI, signal: AbortSignal): Promise<string> {
|
|
242
|
-
const
|
|
223
|
+
const result = await probeCli(pi, "agy", ["-p", "/usage", "--output-format", "json", "--print-timeout", "30s", "--sandbox"], signal, 35_000);
|
|
224
|
+
if (result.killed || result.code !== 0) throw new Error(agyFailureMessage("check account usage", result));
|
|
243
225
|
try {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
{ cwd: runDirectory, signal, timeout: 35_000 },
|
|
248
|
-
);
|
|
249
|
-
if (signal.aborted) throw new Error("Canceled.");
|
|
250
|
-
if (result.killed || result.code !== 0) throw new Error(agyFailureMessage("check account usage", result));
|
|
251
|
-
try {
|
|
252
|
-
return formatAgyUsage(JSON.parse(result.stdout));
|
|
253
|
-
} catch (error) {
|
|
254
|
-
throw new Error(withDoctor(error instanceof SyntaxError ? "Agy returned invalid usage data." : error));
|
|
255
|
-
}
|
|
256
|
-
} finally {
|
|
257
|
-
await rm(runDirectory, { recursive: true, force: true });
|
|
226
|
+
return formatAgyUsage(JSON.parse(result.stdout));
|
|
227
|
+
} catch (error) {
|
|
228
|
+
throw new Error(withDoctor(error instanceof SyntaxError ? "Agy returned invalid usage data." : error));
|
|
258
229
|
}
|
|
259
230
|
}
|
|
260
231
|
|
|
@@ -297,10 +268,6 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
|
|
|
297
268
|
? CAPABILITIES.some(capability => capabilityBackend(settings, capability) === backend)
|
|
298
269
|
: backend === "agy";
|
|
299
270
|
const agyInUse = backendInUse("agy");
|
|
300
|
-
const claudeInUse = backendInUse("claude");
|
|
301
|
-
const grokInUse = backendInUse("grok");
|
|
302
|
-
const codexInUse = backendInUse("codex");
|
|
303
|
-
const museInUse = backendInUse("muse");
|
|
304
271
|
const piInUse = backendInUse("pi");
|
|
305
272
|
|
|
306
273
|
let agyStarted = false;
|
|
@@ -335,69 +302,30 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
|
|
|
335
302
|
pass("Agy", "not probed — no feature selects the Agy backend");
|
|
336
303
|
}
|
|
337
304
|
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
fail("Claude", error);
|
|
346
|
-
}
|
|
347
|
-
try {
|
|
348
|
-
pass("Claude auth", await checkClaudeAuth(pi, signal));
|
|
349
|
-
} catch (error) {
|
|
350
|
-
if (signal.aborted) throw error;
|
|
351
|
-
fail("Claude auth", error);
|
|
352
|
-
}
|
|
353
|
-
} else {
|
|
354
|
-
pass("Claude", "not probed — no feature selects the Claude backend");
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Version only, never a model request. No Grok auth probe exists, so a passing
|
|
358
|
-
// version says the CLI starts — it says nothing about auth or connectivity.
|
|
359
|
-
if (grokInUse) {
|
|
360
|
-
try {
|
|
361
|
-
pass("Grok", await checkCliVersion(pi, "grok", "Grok", signal));
|
|
362
|
-
} catch (error) {
|
|
363
|
-
if (signal.aborted) throw error;
|
|
364
|
-
fail("Grok", error);
|
|
365
|
-
}
|
|
366
|
-
pass("Grok auth", "unverified — no auth probe exists (version does not imply auth or connectivity)");
|
|
367
|
-
} else {
|
|
368
|
-
pass("Grok", "not probed — no feature selects the Grok backend");
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Version and auth status only, never a model request.
|
|
372
|
-
if (codexInUse) {
|
|
373
|
-
try {
|
|
374
|
-
pass("Codex", await checkCliVersion(pi, "codex", "Codex", signal));
|
|
375
|
-
} catch (error) {
|
|
376
|
-
if (signal.aborted) throw error;
|
|
377
|
-
fail("Codex", error);
|
|
305
|
+
// These CLIs share a version probe; only Claude and Codex have a supported auth probe.
|
|
306
|
+
// Grok and Muse must still say "unverified" rather than implying login or connectivity.
|
|
307
|
+
for (const backend of ["claude", "grok", "codex", "muse"] as const) {
|
|
308
|
+
const label = EXTERNAL_BACKENDS[backend].label;
|
|
309
|
+
if (!backendInUse(backend)) {
|
|
310
|
+
pass(label, `not probed — no feature selects the ${label} backend`);
|
|
311
|
+
continue;
|
|
378
312
|
}
|
|
379
313
|
try {
|
|
380
|
-
pass(
|
|
314
|
+
pass(label, await checkCliVersion(pi, backend, label, signal));
|
|
381
315
|
} catch (error) {
|
|
382
316
|
if (signal.aborted) throw error;
|
|
383
|
-
fail(
|
|
317
|
+
fail(label, error);
|
|
384
318
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
pass("
|
|
394
|
-
} catch (error) {
|
|
395
|
-
if (signal.aborted) throw error;
|
|
396
|
-
fail("Muse", error);
|
|
319
|
+
if (backend === "claude" || backend === "codex") {
|
|
320
|
+
try {
|
|
321
|
+
pass(`${label} auth`, await (backend === "claude" ? checkClaudeAuth(pi, signal) : checkCodexAuth(pi, signal)));
|
|
322
|
+
} catch (error) {
|
|
323
|
+
if (signal.aborted) throw error;
|
|
324
|
+
fail(`${label} auth`, error);
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
pass(`${label} auth`, "unverified — no auth probe exists (version does not imply auth or connectivity)");
|
|
397
328
|
}
|
|
398
|
-
pass("Muse auth", "unverified — no auth probe exists (version does not imply auth or connectivity)");
|
|
399
|
-
} else {
|
|
400
|
-
pass("Muse", "not probed — no feature selects the Muse backend");
|
|
401
329
|
}
|
|
402
330
|
|
|
403
331
|
// Pi is in-process: validate the selected physical model against the bridged runtime without a
|
|
@@ -419,42 +347,10 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
|
|
|
419
347
|
|
|
420
348
|
if (settings) {
|
|
421
349
|
const defaultBackend = settings.backend ?? "agy";
|
|
422
|
-
if (defaultBackend
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
} else if (settings.effort === "default") {
|
|
427
|
-
pass("Reasoning effort", "built into the selected model");
|
|
428
|
-
} else {
|
|
429
|
-
pass("Reasoning effort", settings.effort);
|
|
430
|
-
}
|
|
431
|
-
} else if (defaultBackend === "grok") {
|
|
432
|
-
pass("Selected model", `grok \`${settings.model}\``);
|
|
433
|
-
if (!isGrokEffort(settings.effort)) {
|
|
434
|
-
fail("Reasoning effort", `\`${settings.effort}\` is unsupported. Run \`/bro config\` to choose another.`);
|
|
435
|
-
} else if (settings.effort === "default") {
|
|
436
|
-
pass("Reasoning effort", "built into the selected model");
|
|
437
|
-
} else {
|
|
438
|
-
pass("Reasoning effort", settings.effort);
|
|
439
|
-
}
|
|
440
|
-
} else if (defaultBackend === "codex") {
|
|
441
|
-
pass("Selected model", `codex \`${settings.model}\``);
|
|
442
|
-
if (!isCodexEffort(settings.effort)) {
|
|
443
|
-
fail("Reasoning effort", `\`${settings.effort}\` is unsupported. Run \`/bro config\` to choose another.`);
|
|
444
|
-
} else if (settings.effort === "default") {
|
|
445
|
-
pass("Reasoning effort", "built into the selected model");
|
|
446
|
-
} else {
|
|
447
|
-
pass("Reasoning effort", settings.effort);
|
|
448
|
-
}
|
|
449
|
-
} else if (defaultBackend === "muse") {
|
|
450
|
-
pass("Selected model", `muse \`${settings.model}\``);
|
|
451
|
-
if (!isMuseEffort(settings.effort)) {
|
|
452
|
-
fail("Reasoning effort", `\`${settings.effort}\` is unsupported. Run \`/bro config\` to choose another.`);
|
|
453
|
-
} else if (settings.effort === "default") {
|
|
454
|
-
pass("Reasoning effort", "built into the selected model");
|
|
455
|
-
} else {
|
|
456
|
-
pass("Reasoning effort", settings.effort);
|
|
457
|
-
}
|
|
350
|
+
if (isExternalBackend(defaultBackend) && defaultBackend !== "pi") {
|
|
351
|
+
// readSettings already validates each external pair against this backend's effort range.
|
|
352
|
+
pass("Selected model", `${defaultBackend} \`${settings.model}\``);
|
|
353
|
+
pass("Reasoning effort", settings.effort === "default" ? "built into the selected model" : settings.effort);
|
|
458
354
|
} else if (defaultBackend === "pi") {
|
|
459
355
|
const parts = splitPiModel(settings.model);
|
|
460
356
|
const physical = parts ? findPiModel(parts.providerId, parts.modelId) : undefined;
|
|
@@ -469,11 +365,7 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
|
|
|
469
365
|
pass("Selected model", `pi \`${settings.model}\``);
|
|
470
366
|
}
|
|
471
367
|
}
|
|
472
|
-
|
|
473
|
-
fail("Reasoning effort", `\`${settings.effort}\` is unsupported. Run \`/bro config\` to choose another.`);
|
|
474
|
-
} else {
|
|
475
|
-
pass("Reasoning effort", piEffortDetail(physical, settings.effort));
|
|
476
|
-
}
|
|
368
|
+
pass("Reasoning effort", piEffortDetail(physical, settings.effort));
|
|
477
369
|
} else if (models) {
|
|
478
370
|
const current = resolveCatalogSettings(settings, models);
|
|
479
371
|
if (!current.family) {
|
|
@@ -503,59 +395,12 @@ export async function doctorReport(pi: ExtensionAPI, ctx: ExtensionCommandContex
|
|
|
503
395
|
pass(label, detail);
|
|
504
396
|
if (reviewNotice) lines.push(`- ℹ **${label}:** ${reviewNotice}`);
|
|
505
397
|
};
|
|
506
|
-
if (backend
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
continue;
|
|
510
|
-
}
|
|
511
|
-
passCapability(
|
|
512
|
-
override
|
|
513
|
-
? `override claude \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
|
|
514
|
-
: `claude \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
|
|
515
|
-
);
|
|
516
|
-
continue;
|
|
517
|
-
}
|
|
518
|
-
if (backend === "grok") {
|
|
519
|
-
if (!isGrokEffort(pair.effort)) {
|
|
520
|
-
fail(label, `\`${pair.effort}\` is unsupported for grok \`${pair.model}\`. Run \`/bro config\` to fix this.`);
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
passCapability(
|
|
524
|
-
override
|
|
525
|
-
? `override grok \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
|
|
526
|
-
: `grok \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
|
|
527
|
-
);
|
|
528
|
-
continue;
|
|
529
|
-
}
|
|
530
|
-
if (backend === "codex") {
|
|
531
|
-
if (!isCodexEffort(pair.effort)) {
|
|
532
|
-
fail(label, `\`${pair.effort}\` is unsupported for codex \`${pair.model}\`. Run \`/bro config\` to fix this.`);
|
|
533
|
-
continue;
|
|
534
|
-
}
|
|
535
|
-
passCapability(
|
|
536
|
-
override
|
|
537
|
-
? `override codex \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
|
|
538
|
-
: `codex \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
|
|
539
|
-
);
|
|
540
|
-
continue;
|
|
541
|
-
}
|
|
542
|
-
if (backend === "muse") {
|
|
543
|
-
if (!isMuseEffort(pair.effort)) {
|
|
544
|
-
fail(label, `\`${pair.effort}\` is unsupported for muse \`${pair.model}\`. Run \`/bro config\` to fix this.`);
|
|
545
|
-
continue;
|
|
546
|
-
}
|
|
547
|
-
passCapability(
|
|
548
|
-
override
|
|
549
|
-
? `override muse \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`
|
|
550
|
-
: `muse \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`} · using the shared default`,
|
|
551
|
-
);
|
|
398
|
+
if (isExternalBackend(backend) && backend !== "pi") {
|
|
399
|
+
const selection = `${override ? "override " : ""}${backend} \`${pair.model}\`${pair.effort === "default" ? "" : ` (${pair.effort})`}`;
|
|
400
|
+
passCapability(override ? selection : `${selection} · using the shared default`);
|
|
552
401
|
continue;
|
|
553
402
|
}
|
|
554
403
|
if (backend === "pi") {
|
|
555
|
-
if (!isPiEffort(pair.effort)) {
|
|
556
|
-
fail(label, `\`${pair.effort}\` is unsupported for pi \`${pair.model}\`. Run \`/bro config\` to fix this.`);
|
|
557
|
-
continue;
|
|
558
|
-
}
|
|
559
404
|
const parts = splitPiModel(pair.model);
|
|
560
405
|
if (!parts) {
|
|
561
406
|
fail(label, `\`${pair.model}\` is not a \`<provider>/<id>\` Pi model. Run \`/bro config\` to fix this.`);
|