diff --git a/home/progs/pi.nix b/home/progs/pi.nix index b1528f9..c835f68 100644 --- a/home/progs/pi.nix +++ b/home/progs/pi.nix @@ -37,17 +37,21 @@ let in { home.packages = [ + # `bun2nix.hook` sets `patchPhase = bunPatchPhase`, which only runs `patchShebangs` and + # silently ignores the standard `patches` attribute. Apply patches via `prePatch` instead + # so they actually take effect. Tracking: nothing upstream yet. (inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.omp.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ - # Retry without strict tools when DeepSeek (via OpenRouter) rejects strict-mode `anyOf` - # nullable unions with `Invalid tool parameters schema : field \`anyOf\`: missing field \`type\``. - # Upstream PR: pending; applies cleanly against v14.2.1. - ../../patches/omp/0001-openai-completions-retry-without-strict-on-deepseek-openrouter.patch - # Stub `reasoning_content` on tool-call assistant messages for OpenRouter reasoning models. - # Fixes DeepSeek V4 Pro et al. rejecting follow-up requests with `400 The \`reasoning_content\` - # in the thinking mode must be passed back to the API`. Mirrors the existing Kimi handling. - ../../patches/omp/0002-openai-completions-stub-reasoning-content-for-openrouter.patch - ]; + prePatch = + (old.prePatch or "") + + '' + # 0001 — retry without strict tools when DeepSeek (via OpenRouter) rejects strict-mode + # `anyOf` nullable unions with `Invalid tool parameters schema : field \`anyOf\`: + # missing field \`type\``. + patch -p1 < ${../../patches/omp/0001-openai-completions-retry-without-strict-on-deepseek-openrouter.patch} + # 0002 — require `reasoning_content` for OpenRouter reasoning models so DeepSeek V4 Pro + # et al. accept follow-up requests in thinking mode. + patch -p1 < ${../../patches/omp/0002-openai-completions-stub-reasoning-content-for-openrouter.patch} + ''; })) ];