Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

TUI and web launcher crash with an unhandled 'error' event when the browser opener cannot be spawned

已关闭
#2,533 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
cli, web-dev

调研方向

Start with clients/tui/src/utils/openUrl.ts and clients/web/server/web-server-config.ts, then compare their browser-opening paths with the CLI fix in #2531. Trace the ChildProcess returned by open(...) and verify both launchers handle spawn failures without crashing, fall back to asking the user to open the URL manually, and cover the shared behavior if a helper is introduced.

由索引模型根据 Issue 内容生成。

描述

bug v2

Problem

Follow-up to #2531, which fixes the CLI. The TUI and the web launcher call open the same way and have the same defect.

open (10.2.0) resolves with the ChildProcess as soon as it has called spawn(). A spawn failure (ENOENT: the opener binary is missing from PATH) arrives afterwards as an 'error' event on that child. open only listens for it with { wait: true }, and on macOS that option adds open -W, which waits for the browser to quit. With nobody listening, the event crashes the process.

  • TUI: clients/tui/src/utils/openUrl.ts awaits open(...) for the OAuth authorization page. A spawn failure crashes the TUI mid-flow.
  • Web launcher: clients/web/server/web-server-config.ts openBrowser() does open(url).catch(...). The .catch covers a rejection but not the child's 'error' event, so a spawn failure crashes the web server at startup whenever auto-open is on.

Expected

Both sites handle a spawn failure the way #2531 makes the CLI handle it: listen on the returned child for 'error'/'spawn', chained directly onto open's promise, then fall back to "open the URL manually". A single shared helper would stop the three copies from drifting apart again.

Likelihood

Low on a normal machine (/usr/bin/open on macOS; open ships its own xdg-open on Linux), but real wherever the opener is missing from PATH: minimal containers, sandboxed or env -i launches.

主要语言
TypeScript
星标
11.1k
派生
1.6k
平均合并
4 小时 32 分钟
30 天内合并 PR
136

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/inspector 的其他 Issue

查看 modelcontextprotocol/inspector 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。