На macOS плагин не запускается: нет timeout, и Codex читается как «не залогинен» - #3
Merged
Merged
Conversation
`timeout` is GNU coreutils. A stock macOS does not have it, Homebrew installs it as `gtimeout`, and many machines have neither. The failure is silent and total: timeout 10 codex login status 2>&1 | grep -qi 'logged in' The shell writes 'command not found', grep reads empty stdin, and the probe reports 'codex: NOT LOGGED IN' on a machine where `codex login status` answers 'Logged in using ChatGPT'. The review skill then hits its own gate — 'No Codex, or not logged in -> stop' — so the whole plugin declines to run. Measured on macOS with codex-cli 0.144.6, logged in: NOT LOGGED IN before, OK after. The same call is used for OpenRouter and Gemini, where the timeout is not cosmetic: the comment above multi_run_openrouter says it outright — Claude Code does not fail fast on a bad key, it retries silently and never returns. So the fallback runs the timeout itself rather than dropping it. multi_timeout picks timeout, then gtimeout, then a background-and-watchdog implementation. Verified on a machine with neither: a fast command keeps its output and exit code, a failing one keeps its non-zero code, `sleep 30` under a 2s limit dies in 2s with rc=143, and the pipeline above resolves correctly.
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.
Поставил плагин себе, запустил — и он отказался работать. Оказалось, на macOS он не работает вообще. Пишу по-русски, коммит на английском, как и весь репо.
Что происходит
timeout— это GNU coreutils. На чистом macOS её нет; Homebrew ставит её какgtimeout, а на многих машинах нет ни того, ни другого. Отказ при этом тихий и полный:Шелл пишет
command not found,grepчитает пустой stdin,probe.shпечатаетcodex: NOT LOGGED IN. Дальше срабатывает гейт самого скилла — «No Codex, or not logged in → stop» — и плагин целиком отказывается запускаться.Замер на моей машине (macOS,
codex-cli 0.144.6, залогинен):То есть Codex подключён, а плагин его не видит и стопорится.
Почему нельзя просто убрать timeout
Он используется в четырёх местах, и в двух из них он не косметика — это написано в комментарии над
multi_run_openrouterтвоей же рукой: Claude Code не падает быстро на плохом ключе, он молча ретраит и не возвращается. Без жёсткого лимита этот вызов висит вечно.Поэтому фолбэк не «пропустить таймаут», а «сделать его самим».
Что в патче
multi_timeoutвproviders.sh(он и так подключается изprobe.sh,ask.sh,setup.sh): берётtimeout, если он есть, иначеgtimeout, иначе своя реализация через фоновый запуск и сторожа. Все четыре вызова переведены на неё —probe.sh×2 (codex, opencode),providers.sh×2 (openrouter, gemini).Дифф: +37 / −4, два файла, ни одного нового.
Проверено на машине, где нет ни
timeout, ниgtimeoutecho hello→hellotrue→ rc=0false→ rc=1sleep 30с лимитом 2с → убито за 2с, rc=143probe.sh→ codex распознанПоследняя строка важнее прочих: shim, который «не падает», но и не убивает зависший процесс, был бы хуже исходного бага — он бы молча вернул openrouter к бесконечному ретраю.
Воспроизвести можно так (на маке без coreutils):
Отношение к PR #2
Ветка отведена от
main, а не отfeat/safe-paths-preflight— они независимы, порядок влития любой, стека не будет. Этот PR я бы взял вперёд того: там гипотетический риск, здесь продукт не стартует на целой платформе.