fix: resolve 4 small issues reported in #663

1. Windows: `start` command opens CMD instead of browser during GitHub
   Copilot login — pass empty title arg so URL is treated as target
2. Launch banner missing Tavily provider in web search status display
3. MCPorter auto-installs via npm when not found (like ripgrep auto-download)
4. Notification prefs showing [object Object] — guard against non-boolean values

Closes #663

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-16 12:23:20 -06:00
parent 2966be30cb
commit a58e256e42
4 changed files with 27 additions and 8 deletions

View file

@ -132,9 +132,14 @@ export class LoginDialogComponent extends Container implements Focusable {
this.contentContainer.addChild(new Text(theme.fg("warning", instructions), 1, 0));
}
// Try to open browser
// Try to open browser — on Windows, `start` needs an empty title arg
// so it treats the URL as a target, not a window title
const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
exec(`${openCmd} "${url}"`);
if (process.platform === "win32") {
exec(`start "" "${url}"`);
} else {
exec(`${openCmd} "${url}"`);
}
this.tui.requestRender();
}

View file

@ -1095,7 +1095,7 @@ async function configureNotifications(ctx: ExtensionCommandContext, prefs: Recor
for (const field of notifFields) {
const current = notif[field.key];
const currentStr = current !== undefined ? String(current) : "";
const currentStr = current !== undefined && typeof current === "boolean" ? String(current) : "";
const choice = await ctx.ui.select(
`${field.label}${currentStr ? ` (current: ${currentStr})` : ` (default: ${field.defaultVal})`}:`,
["true", "false", "(keep current)"],

View file

@ -418,12 +418,24 @@ export default function (pi: ExtensionAPI) {
pi.on("session_start", async (_event, ctx) => {
try {
const ver = (await runMcporter(["--version"], undefined, 5000)).trim();
ctx.ui.notify(`MCPorter ${ver} ready`, "info");
ctx.ui.notify(`MCPorter ${ver} ready`, "info");
} catch {
ctx.ui.notify(
"MCPorter not found. Install with: npm i -g mcporter",
"error",
);
ctx.ui.notify("MCPorter not found — attempting auto-install…", "warning");
try {
await new Promise<void>((resolve, reject) => {
exec("npm install -g mcporter", { timeout: 60000 }, (err) => {
if (err) reject(err);
else resolve();
});
});
const ver = (await runMcporter(["--version"], undefined, 5000)).trim();
ctx.ui.notify(`MCPorter ${ver} auto-installed ✓`, "info");
} catch {
ctx.ui.notify(
"MCPorter auto-install failed. Install manually: npm i -g mcporter",
"error",
);
}
}
});
}

View file

@ -157,11 +157,13 @@ export function registerNativeSearchHooks(pi: NativeSearchPI): { getIsAnthropic:
const hasBrave = !!process.env.BRAVE_API_KEY;
const hasJina = !!process.env.JINA_API_KEY;
const hasAnswers = !!process.env.BRAVE_ANSWERS_KEY;
const hasTavily = !!process.env.TAVILY_API_KEY;
const parts: string[] = ["Web search v4 loaded"];
if (hasBrave) parts.push("Brave ✓");
if (hasAnswers) parts.push("Answers ✓");
if (hasJina) parts.push("Jina ✓");
if (hasTavily) parts.push("Tavily ✓");
ctx.ui.notify(parts.join(" · "), "info");
});