Repository navigation
fix: macOS の対話インストールで claude CLI が kqueue エラーで失敗する問題を修正(v0.78.2) - #174
Merged
Merged
Conversation
install.sh は curl | bash でもウィザードが入力を読めるよう setup.sh を </dev/tty で起動する。Bun 製のネイティブ claude CLI は plugin / mcp 系 サブコマンドで stdin を kqueue に登録するが、macOS の kqueue は /dev/tty という別名デバイスを拒否するため、claude plugin marketplace add / list / install が "EINVAL: invalid argument, kqueue" で失敗していた。新規 Mac では 既定プラグインが 1 つも入らず、install_selected_plugins の非 0 終了で Codex Plugin セットアップと Claude CLI の最終確認も実行されなかった。 - lib/codex-setup.sh: stdin を /dev/null にして claude を実行する _claude_cli() を追加し、Codex プラグイン導入・レガシー MCP 判定/削除を 経由させた - setup.sh: プラグイン一覧取得・marketplace 追加・install を _claude_cli 経由に - lib/deploy.sh: claude --version に </dev/null を付与 - uninstall.sh: 自己完結のため Codex 後片付けの claude 呼び出しに </dev/null を直接付与(確認プロンプトの read は従来どおり) - tests/unit/test-codex-setup.sh: _claude_cli が呼び出し元の stdin を 引き継がないことのプローブと、同梱スクリプトの claude plugin|mcp|--version 呼び出しを検査する静的ガードを追加(修正前コードでは 13 箇所を検出) ローカル確認: shellcheck(変更 5 ファイル)、test-codex-setup 19/19、 全ユニット 832/833(残る fonts 1 件は main でも同一の既知 FAIL)、実 claude で stdin=/dev/tty の E2E rc=0
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
レビューで確認した指摘への対応。 - tests/unit/test-codex-setup.sh: 静的ガードの除外条件を行全体の部分一致から 呼び出し単位に絞った。表示行の除外は行頭のログ出力コマンドに限り、 </dev/null は claude コマンド自身のリダイレクトだけを数える。 `claude plugin list || warn ...` や `claude plugin list; cat </dev/null` の ような裸の呼び出しを検出するようになり、`< /dev/null`(空白入り)は 誤検出しなくなった。検査対象に install.sh と wizard/*.sh を追加し、 テスト名とコメントを検査範囲(plugin / mcp / --version)に合わせ、 else 節を字下げした。origin/main に対する検出数は 13 箇所のまま - CHANGELOG.md: 日付をマージ日に更新。対象を claude plugin / mcp / --version の 呼び出しと明記し、anthropic-agent-skills の失敗表示は Full プロファイルの 場合であることを補足 - CLAUDE.md: Key Conventions に _claude_cli() の規約を追加
修正コミットの再レビューで確認した指摘への対応。 - tests/unit/test-codex-setup.sh: `"claude plugin install ...` の除外を文字列だけの 継続行に限定し、表示行の除外ではコマンド置換より後ろの claude を除外しない ようにした。`claude plugin install x || warn "claude plugin install failed"` と `info "$(claude --version)"` の形を検出する。origin/main に対する検出数は 13 箇所のまま - CHANGELOG.md / CLAUDE.md: リダイレクトを直接書いているのは uninstall.sh だけ ではなく lib/deploy.sh のバージョン取得も含むため、記述を実装に合わせた
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
新規 Mac で対話インストール(
curl | bash)を実行すると、claude plugin marketplace add/plugin list/plugin installがerror: EINVAL: invalid argument, kqueueで失敗し、既定プラグインが 1 つも入らない問題を修正します(v0.78.2)。原因
install.shは、ウィザードが入力を読めるようにsetup.shの stdin を</dev/ttyに付け替えて起動する/dev/ttyという別名デバイスを EINVAL で拒否する。実 pty(/dev/ttysNNN)、パイプ、/dev/nullであれば成功するscript -q /dev/null bash -c 'claude plugin list </dev/tty; echo rc=$?' </dev/nulltty.WriteStreamfails withEINVAL: invalid argument, kqueueon macOS when opening/dev/ttyoven-sh/bun#24158ユーザーに見える変更
install_selected_pluginsの失敗によって後続の Codex Plugin セットアップ(有効時)と Claude CLI の最終確認がスキップされていたが、修正後は実行されるbash setup.shの直接実行、非対話インストール、Linux / WSL(epoll)は従来どおり影響を受けないinstall.shの再実行(更新モード)か、/plugin marketplace add ...で復旧できる(CHANGELOG に記載)変更内容
lib/codex-setup.sh_claude_cli() { claude "$@" </dev/null; }を追加し、Codex プラグイン導入とレガシー MCP の判定・削除を経由させたsetup.sh_claude_cli経由に変更lib/deploy.shclaude --versionに</dev/nullを追加uninstall.shclaude呼び出しに</dev/nullを直接追加。確認プロンプトのreadは従来どおり利用者の入力を読むtests/unit/test-codex-setup.sh_claude_cliが呼び出し元の stdin を引き継がないこと)と、同梱スクリプト内のclaude plugin|mcp|--version呼び出しが_claude_cliまたは</dev/nullを経由していることの静的ガードを追加。修正前のコードでは 13 箇所を検出するCHANGELOG.md[0.78.2] - 2026-10-05の Fixed エントリリスク
/dev/nullに置き換えても挙動は変わらないclaudeを別の書き方(変数経由など)で呼ぶと検出できない可能性があるuninstall.shのclaude uninstall(CLI 2.1.289 にこのサブコマンドが存在しない)は本 PR の範囲外。別 Issue で扱う実行した検査
shellcheck -S warning: 変更した 5 ファイルとも OKtests/unit/test-codex-setup.sh(runner 経由): 19/19 PASSbash tests/run-unit-tests.sh: 833 件中 832 件 PASS。残る 1 件fonts: direct download fallback receives font definitionは main でも同じく FAIL する既知の事象/dev/ttyにした E2E: rc=0tests/run-mdm-tests.sh): detect は 342 PASS / 1 SKIP。test-mdm-install.shの 3 件(non-root dry-run の policy / 一時 checkout 系)がローカルで FAIL したgit cloneし、setup.sh をダミーに差し替えて未変更のmdm/install-mdm.shだけを使う構造なので、未コミットの差分が入る経路がない。別ユーザー権限で実行される環境依存のテストでもある