Files
OmniRoute/tests
phs1997 16f8837acf fix(chatCore): only preserve tool_result blocks for Claude-native targets (#13972)
* fix(chatCore): only preserve tool_result blocks for Claude-native targets

When forwarding requests through the CC-bridge or Claude passthrough paths
to OpenAI-compatible upstream targets (e.g. logfare, OpenRouter), Anthropic-shape
tool_result content parts in user messages were preserved unchanged, causing
upstream gateways to reject the request with HTTP 503.

Gate preserveToolResultBlocks on targetFormat === FORMATS.CLAUDE so that
OpenAI targets receive properly normalized content strings.

Fixes #13971

* fix(chatCore): add regression coverage for the CC-bridge tool_result guard

Adds a one-line clarifying comment on the isClaudePassthrough call site (the
guard is a no-op there by construction) and two chatcore-translation-paths
tests proving the CC-bridge branch strips raw tool_result blocks for
OpenAI-compatible targets while still preserving them for Claude-native ones.

---------

Co-authored-by: phs1997 <phs1997@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-09-19 00:05:34 -03:00
..