Files
OmniRoute/open-sse/utils
Diego Rodrigues de Sa e Souza d095555d68 fix(sse): gate reasoning-placeholder strip to chunks that contain the sentinel (#8382)
Regression: #8162 (port of #8081) added an unconditional `.trim()` to
stripInternalReasoningPlaceholder(), applied to every streaming
delta.content chunk across 3 call-sites (openai-to-claude.ts,
openai-responses.ts, responsesTransformer.ts). Leading/trailing
whitespace at a chunk boundary is a real word boundary between
streaming fragments; trimming it glues adjacent chunks together on
the client ("Hello, " + "world." + " Bye." -> "Hello,world.Bye.").

Fix: early-return via .includes() before the replaceAll+trim, so the
function is a true no-op when the sentinel is absent from the chunk.
Behavior when the sentinel IS present is unchanged.

Validation:
- tests/unit/streaming-reasoning-dedup-5786.test.ts: the "(A-guard)"
  test was RED on the base branch ('Hello,world.Bye.' vs
  'Hello, world. Bye.'); GREEN after the fix (4/4 passing).
- tests/unit/translator-resp-openai-to-claude.test.ts: added a new
  multi-chunk boundary-whitespace regression test, proven RED against
  the pre-fix code (12/13), GREEN after (13/13).
- No regressions in responses-transformer.test.ts (17/17),
  responses-transformer-dense-output.test.ts (3/3), or the other
  suites exercising the shared placeholder utility (160/160 total
  across all consumers).

Refs #8162
Refs #8081
2026-07-24 09:56:54 -03:00
..
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-07-04 13:00:30 -03:00
2026-06-29 08:40:06 -03:00
2026-06-26 02:51:06 -03:00
2026-05-29 12:44:29 -03:00
2026-06-20 14:55:24 -03:00
2026-06-28 06:58:29 -03:00
2026-06-26 02:51:06 -03:00
2026-05-26 23:51:47 -03:00
2026-06-09 15:56:24 -03:00
2026-06-13 17:27:40 -03:00
2026-06-13 17:27:40 -03:00
2026-06-27 09:07:12 -03:00
2026-05-29 12:44:29 -03:00
2026-06-30 06:54:29 -03:00
2026-06-07 07:20:02 -03:00
2026-06-26 02:51:06 -03:00
2026-07-02 10:47:13 -03:00