Repository navigation
Description
Summary
The hook rewrite strips pnpm exec biome as a prefix, so the explicitly-named linter is thrown away and the linter's first subcommand becomes the linter name:
$ rtk hook check "pnpm exec biome ci ."
rtk lint ci .rtk lint ci . then runs pnpm exec ci ., which doesn't exist, exits 254, and is reported as [warn] Linter process terminated abnormally (possibly out of memory).
biome ci . is Biome's own documented CI entrypoint (https://biomejs.dev/reference/cli/#biome-ci), so every Biome project whose lint script is biome ci . hits this.
This is a different trigger from #2879 (bare pnpm lint → no args → ESLint default). Here the user explicitly names biome on the command line and rtk still doesn't route to the Biome adapter. Related but not the same: #2879, #1489, #2540, #665. Searched "pnpm exec biome" and detect_linter — no existing issue covers this path.
Repro
Project with Biome and no ESLint, "lint": "biome ci .":
$ rtk hook check "pnpm exec biome ci ."
rtk lint ci .
$ rtk hook check "pnpm exec biome --version"
rtk lint --version
$ pnpm exec biome ci . # via the Claude Code PreToolUse hook (`rtk hook claude`)
[warn] Linter process terminated abnormally (possibly out of memory)
exit=254
$ pnpm exec biome --version
[warn] Linter process terminated abnormally (possibly out of memory)
exit=254Both are healthy commands. Bypassing rtk proves it:
$ rtk proxy pnpm exec biome ci . ; echo "exit=$?"
exit=0
$ ./node_modules/.bin/biome --version
Version: 2.4.16
$ /usr/bin/time -l ./node_modules/.bin/biome ci .
0.21 real 1.09 user 0.53 sys
98369536 maximum resident set size # 98 MB on a 128 GB machinertk lint names the bogus linter out loud under -v:
$ rtk -v lint ci .
Running: ci with structured output
[warn] Linter process terminated abnormally (possibly out of memory)
$ pnpm exec ci .
undefined
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "ci" not found
exit=254Root cause (verified against tag v0.43.0)
-
src/discover/rules.rs:153— the rule^((p?np(m|x)|p?npm\s+(exec|run|run-script)|npm\s+(rum|urn|x)|pnpm\s+dlx)\s+)?(biome|eslint|lint)(\s|$)maps tortk_cmd: "rtk lint"(L154), and"pnpm exec biome"is listed verbatim inrewrite_prefixes(L185). Because the whole matched span — including the linter name — is consumed as a prefix,pnpm exec biome ci .becomesrtk lint ci .. The information that the user asked for biome is gone by the timertk lintstarts. -
src/cmds/js/lint_cmd.rs:77-88—detect_linter(["ci", "."]):let is_path_or_flag = args.is_empty() || args[0].starts_with('-') || args[0].contains('/') || args[0].contains('.'); if is_path_or_flag { ("eslint", false) } else { (&args[0], true) }
"ci"has no-,/or., so it is taken as an explicitly specified linter namedciand rtk runspnpm exec ci ..(For
pnpm exec biome --version→rtk lint --version,args[0]starts with-, so it falls to the("eslint", false)default and runs ESLint instead — the bug: pnpm lint hook rewrite defaults to ESLint; "command not found" (exit 254) misreported as "possibly out of memory" #2879 shape.) -
src/cmds/js/lint_cmd.rs:173-174— pnpm's "command not found" exit code is 254, andexit_code > 128is treated as death-by-signal:if !result.success() && result.exit_code > 128 { eprintln!("[warn] Linter process terminated abnormally (possibly out of memory)");
Nothing was killed and nothing ran out of memory. (Same misclassification as bug: pnpm lint hook rewrite defaults to ESLint; "command not found" (exit 254) misreported as "possibly out of memory" #2879 step 3.)
Why this is costly for agents
The message names a resource problem, so an LLM agent chases memory. In our repo this cost real time: an agent concluded pnpm exec biome ci . OOMs on this machine and recorded RAYON_NUM_THREADS=2 as the fix. That workaround does nothing — the env prefix is preserved through the rewrite and the rewrite still fires:
$ rtk hook check "RAYON_NUM_THREADS=2 pnpm exec biome ci ."
RAYON_NUM_THREADS=2 rtk lint ci .
$ RAYON_NUM_THREADS=2 pnpm exec biome ci . ; echo "exit=$?"
[warn] Linter process terminated abnormally (possibly out of memory)
exit=254The real Biome run takes 0.21 s and 98 MB.
Suggested fix
Any of, ideally 1 + 3:
- Keep the linter name. When the rule matched
biome/eslintexplicitly, pass it through:pnpm exec biome ci .→rtk lint biome ci .(or dispatch straight to the Biome adapter). Only the barelintscript name should be ambiguous. - Never guess from
args[0].detect_lintershould matchargs[0]against the known linter set rather than accepting any bare word as a linter —ci,check,formatare Biome/other subcommands, not linters. - Stop reporting 254 as OOM. Detect pnpm's
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL/Command "X" not foundand sayX is not installed(or fall back to passthrough). A> 128check is not a valid signal-death test for pnpm/npm wrappers.
Given #665, #1489, #2094, #2540, #2832 and #2879 all stem from "the lint rewrite guesses the linter", the durable fix is probably (1)+(2): never dispatch to a linter that the command line didn't actually name.
Environment
- rtk 0.42.4 (Homebrew, macOS 26.5.1 arm64) — behaviour observed; source read and line-referenced at tag v0.43.0, where the code is unchanged
- pnpm 10.33.2, Node v25.8.1, Biome 2.4.16, no ESLint anywhere in the dependency tree
lintscript:biome ci .
Activity
pszymkowiak commentedon Jul 9, 2026
🔍 Automated Triage
bughighSummary
Hook rewrite strips the explicit 'biome' name from 'pnpm exec biome ci .', causing detect_linter to misread 'ci' as the linter and pnpm to fail with exit 254, which is then misreported as an OOM; fix rewrite_prefixes/detect_linter in rules.rs and lint_cmd.rs to preserve the named linter and stop treating exit>128 as signal death.
📁 Relevant files
src/discover/rules.rssrc/cmds/js/lint_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
daniswhoiam commentedon Jul 13, 2026
Corroborating on rtk 0.43.0 (homebrew) / macOS 25.3, with a variant that's arguably worse than the exit-254 case: in a workspace where both Biome and ESLint are installed (Biome 1.9.4 as the active linter,
[email protected]still present as a dormant devDep), the same rewrite produces silent wrong-tool output instead of a loud failure:Because
rtk lint's auto-detection then picks ESLint, an agent (or human) gets plausible-looking output from the wrong linter — in our case a failingpnpm lintscript chain once rendered as a tidy eslint-style rule summary, masking the real failure (the #2540 symptom, reached via this issue's rewrite path).Both non-hook paths behave correctly on the same machine/cwd, so the defect is isolated to the hook rewrite:
Expected behavior from our side: when the user explicitly names the tool (
pnpm exec biome …), the rewrite should either route to the Biome adapter or pass the command through untouched — never a genericrtk lintdispatch that can bind to a different linter.lntutor commentedon Jul 20, 2026
I am working on this against current develop. I will preserve explicit Biome/ESLint names through rewrite, restrict lint auto-detection to known linter names, stop treating pnpm exit 254 as a signal/OOM, and cover the reported
ciand--versionpaths.alexisLefebvre commentedon Jul 23, 2026
Until the rewrite fix lands, there's a config-only workaround via
[hooks] exclude_commandsin~/.config/rtk/config.toml— but the intuitive value does not work, so it's worth spelling out.exclude_commandsmatches the command's leading token, not a substring. The failing invocations are launched through pnpm (pnpm exec biome …,pnpm biome …), whose leading token ispnpm, so:still gets rewritten and still crashes. What actually works is excluding the launcher:
Verified on Linux (Debian glibc 2.41, rtk / Biome 2.3.14,
lint=biome check), same 254 / "possibly out of memory" symptom via the Claude Code PreToolUse hook:Trade-off: this disables rtk's output compaction for every
pnpm …command (typecheck, build, test, …), not just biome — a blunt instrument, but it stops the false-OOM crashes withoutrtk proxyon each call.rtk proxy pnpm exec biome …remains the per-call escape hatch for anyone who wants to keep compaction on other pnpm commands.(Flagging the
["biome"]-doesn't-work gotcha specifically because it's the natural first guess and silently fails.)🤖 Generated with Claude Code
MbBrainz commentedon Sep 29, 2026
For those of you (and your agents) that still have this issue: I recommend setting
exclude_commands = ["biome"]in the rtkconfig.tomlEasiest workaround for as long as this issue stays unsolved.KuSh commentedon Oct 3, 2026
Closing as a duplicate of #3117, which tracks the same problem: an explicit
pnpm exec biome <sub>ornpx biome <sub>is rewritten tortk lint <sub>and the Biome subcommand is lost. #3117 also coverspnpm run lintand the masked failures, so please follow up there.