Files
OmniRoute/src/app/api
Jan Leon ea650253af Stream model health probes for slow providers (#7377)
* fix(model-test): stream slow chat probes

* fix(model-test): handle JSON responses for streaming probes

* fix(model-test): preserve transient errors from streaming probes

* fix(model-test): keep transient probe failures visible

* chore(ci): rerun pull request checks

* docs(model-test): clarify transient failure handling

* chore(ci): rerun pull request checks

* test(model-test): cover slow timeout response path

* chore(quality): register base-branch mutation tests

* fix(sse): stop real-network leak and DOMException crash in model-test-runner timeout path

Two new tests added by this PR fail against the current release tip:

- tests/unit/model-test-runner.test.ts's slow-timeout regression test races
  the cold-start cost of the chat-completions pipeline (SSE translators,
  compression settings, etc. all lazily init on the first real request in a
  process). With a 1s AbortController timeout, the abort can fire before
  chatCore ever reaches the executor's fetch() call; the mocked fetch is then
  invoked after the test's own `finally` block has already restored the real
  fetch, so the assertion on the mock never fires and the request leaks onto
  the real network. Warm up the pipeline with one fast, resolving mock call
  before timing the 1s scenario.

- Once the warm-up unblocks that race, a second, real bug surfaces:
  withRateLimit's abort handling (open-sse/services/rateLimitManager.ts)
  mutates `reason.name = "AbortError"` in place. When `AbortController.abort()`
  is called with no explicit reason (as modelTestRunner's timeout path does),
  the default reason is a native DOMException, whose `name` is a read-only
  getter — the mutation throws `TypeError: Cannot set property name of
  [object DOMException] which has only a getter` instead of rejecting
  cleanly. Build a fresh Error instead of mutating the caller-supplied
  reason, preserving the original as `.cause`.

Adds a focused regression test in tests/unit/rate-limit-manager.test.ts that
reproduces the DOMException crash directly against withRateLimit.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-18 21:18:42 -03:00
..
2026-07-07 13:14:06 -03:00
2026-04-30 14:08:50 -03:00
2026-04-19 19:50:30 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-05-10 00:55:06 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-19 06:49:01 -03:00
2026-07-06 02:25:17 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-07-04 13:00:30 -03:00
2026-06-23 17:06:18 -03:00
2026-05-26 23:51:47 -03:00
2026-04-22 12:26:21 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-06-26 02:51:06 -03:00
2026-06-12 23:49:22 -03:00
2026-07-13 09:12:40 -03:00
2026-06-30 06:54:29 -03:00
2026-06-27 09:07:12 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-23 17:06:18 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-11 18:52:29 -03:00
2026-06-04 20:05:38 -03:00
2026-06-13 17:27:40 -03:00
2026-05-26 23:51:47 -03:00
2026-06-27 09:07:12 -03:00
2026-07-07 13:14:06 -03:00
2026-07-04 13:00:30 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-05-26 23:51:47 -03:00
2026-05-26 23:51:47 -03:00
2026-04-30 01:27:03 -03:00
2026-07-07 13:14:06 -03:00
2026-06-30 06:54:29 -03:00