Simon Gardling 318373c09c pi: patch omp to require reasoning_content for OpenRouter reasoning models
DeepSeek V4 Pro (and similar reasoning models reached via OpenRouter) reject
multi-turn requests in thinking mode with:

  400 The `reasoning_content` in the thinking mode must be passed back
  to the API.

omp's existing kimi placeholder injection (`requiresReasoningContentForToolCalls`)
covered this requirement only for `thinkingFormat == "openai"`. OpenRouter
sets `thinkingFormat == "openrouter"`, so the gate never fired even though
the underlying providers behind OpenRouter (DeepSeek, Kimi, etc.) all enforce
the same invariant.

This patch:

1. Extends `requiresReasoningContentForToolCalls` detection: any
   reasoning-capable model fronted by OpenRouter now sets the flag.
2. Extends the placeholder gate in `convertMessages` to accept
   `thinkingFormat == "openrouter"` alongside `"openai"`.

Cross-provider continuations are the dominant trigger: a conversation
warmed up by Anthropic Claude (whose reasoning is redacted/encrypted on
the wire) followed by a switch to DeepSeek V4 Pro via OpenRouter. omp
cannot synthesize plaintext `reasoning_content` from Anthropic's
encrypted blocks, so the placeholder satisfies DeepSeek's validator
without fabricating a reasoning trace. Real captured reasoning, when
present, short-circuits the placeholder via `hasReasoningField` and
survives intact.

Side benefit: also closes a latent gap where Kimi-via-OpenRouter
(`thinkingFormat == "openrouter"`) had the compat flag set but the
placeholder gate silently rejected it.

Applies cleanly on top of patch 0001.
2026-04-25 19:20:05 -04:00
2026-04-25 10:50:00 -04:00
2026-04-23 01:17:10 -04:00
2026-04-23 20:23:37 -04:00
2026-04-22 23:02:53 -04:00
2026-04-22 07:28:56 -04:00
2026-04-23 22:34:47 -04:00
2026-04-18 01:56:35 -04:00
2026-04-23 20:23:37 -04:00

My NixOS configs

Hosts

  • mreow: My personal Framework 13 laptop
  • yarn: Machine I usually just play games on. Boots into SteamOS-like interface.
  • muffin: Homeserver, runs various services.

Desktop/Laptop

What do I use?

Browser: Firefox 🦊 (actually Zen Browser :p)

Text Editor: Doom Emacs

Terminal: alacritty

Shell: fish with the pure prompt

WM: niri (KDE on my desktop)

Background

  • Got my background from here and used the command magick input.png -filter Point -resize 2880x1920! output.png to upscale it bilinearly
Description
Unified NixOS flake for mreow, yarn, muffin
Readme 3.8 MiB
Languages
Nix 84.6%
Python 10.7%
Emacs Lisp 2.6%
Shell 2.1%