Skip to content

test(sse): register #8396 and #8376 unit tests in stryker tap.testFiles - #8538

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
MumuTW:fix/stryker-register-8396-8376-tests
Jul 25, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
MumuTW:fix/stryker-register-8396-8376-tests

Conversation

@MumuTW

@MumuTW MumuTW commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Problem

check:mutation-test-coverage fails on release/v3.8.49 at its own HEAD (7a8f9156d) — no PR content involved:

open-sse/services/accountFallback.ts
  + tests/unit/8396-cooldown-429-cap.test.ts

open-sse/services/combo/comboPredicates.ts
  + tests/unit/8376-econnrefused-breaker.test.ts

✗ 2 covering unit test(s) across 2 module(s) are missing from stryker.conf.json tap.testFiles.

It is a step in the Fast Quality Gates job, so the job is red for every PR→release/**. It sits behind check:file-size and check:db-rules in the step order, so it only becomes visible once those pass (#8524 and #8534 respectively).

Both tests genuinely exercise a mutated module but were never registered, so their mutant kills do not count toward the mutation score — the gate exists precisely to catch that drift.

Test Mutated module Imports
tests/unit/8396-cooldown-429-cap.test.ts open-sse/services/accountFallback.ts checkFallbackError
tests/unit/8376-econnrefused-breaker.test.ts open-sse/services/combo/comboPredicates.ts shouldRecordProviderBreakerFailure

Change

Two strings added to tap.testFiles, in the array's existing sorted position. No other key in stryker.conf.json is touched — the diff is exactly +2 lines.

Note: the file does not currently satisfy prettier --check on the base either (it has expanded plugins/reporters arrays that Prettier would collapse). I deliberately left that alone rather than reformatting, to keep this diff to the two lines that matter.

Verification

Before After
npm run check:mutation-test-coverage ✗ 2 missing across 2 modules ✓ No drift — every covering unit test is listed (3312 test files scanned against 31 mutated modules)
node --import tsx/esm --test on both files — 10/10 pass
JSON.parse of the config — valid

Related

Part of clearing the base-red surface on this tip, alongside #8524 (check:file-size) and #8534 (check:db-rules). A follow-up will handle the three stale backoff tests, which trace to the same #8396 landing as the first entry here.

…unit tests in stryker tap.testFiles

check:mutation-test-coverage fails on release/v3.8.49 at its own HEAD:
two unit tests cover mutated modules but are absent from tap.testFiles,
so their mutant kills do not count and the drift gate blocks every
PR->release run.

- tests/unit/8396-cooldown-429-cap.test.ts covers
  open-sse/services/accountFallback.ts (imports checkFallbackError)
- tests/unit/8376-econnrefused-breaker.test.ts covers
  open-sse/services/combo/comboPredicates.ts (imports
  shouldRecordProviderBreakerFailure)

Both inserted in the array's existing sorted position; no other key
touched.
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down — the root cause analysis is correct and the two registrations you added (tests/unit/8396-cooldown-429-cap.test.ts, tests/unit/8376-econnrefused-breaker.test.ts) are exactly right: both tests exist, pass 10/10 locally, and were genuinely missing from tap.testFiles as of the commit you branched from (7a8f915).

One thing surfaced during review: release/v3.8.49 has moved since you opened this (now at 3070925, via merged PR #8504), and that merge introduced tests/unit/repro-7503-no-choices.test.ts covering open-sse/utils/error.ts, which is also not yet in tap.testFiles. I confirmed this by cherry-picking your commit onto the current tip and re-running npm run check:mutation-test-coverage — it still reports 1 missing entry instead of 0.

Could you add that third line (same sorted-array pattern, right before tests/unit/repro-antigravity-404-family-cooldown-hijack.test.ts) so the gate actually goes green once merged, rather than trading one drift item for another? Everything else here (scope, the two entries you did add, leaving the pre-existing prettier formatting issue alone) looks good to me. What happens next with sequencing against #8524/#8534 is the maintainer's call.

@diegosouzapw
diegosouzapw merged commit cc63ac9 into cheaper-inference:release/v3.8.49 Jul 25, 2026
5 checks passed
MumuTW added a commit to MumuTW/OmniRoute that referenced this pull request Jul 25, 2026
…tap.testFiles

The new test resets the circuit breaker in beforeEach, so it counts as a covering test
for src/shared/utils/circuitBreaker.ts. Without registering it,
check:mutation-test-coverage --strict reported a 4th drift entry that was not there on the
pristine tip -- new drift introduced by this PR. Registered in sorted position; the gate is
back to the 3 pre-existing entries (accountFallback.ts, error.ts, comboPredicates.ts) that
cheaper-inference#8538 addresses.
diegosouzapw pushed a commit that referenced this pull request Jul 26, 2026
…8553)

* fix(sse): shallow per-target copy for the combo attempt body (#7847)

combo.ts deep-cloned the request body for every target. On a 3.05 MiB agent request that
is 9.53 MiB at 3 targets, and it scales linearly:

  3 targets    9.53 MiB (3.12x wire)  ->  ~0.001 MiB
  5 targets   15.89 MiB (5.19x wire)  ->  ~0.000 MiB
 10 targets   31.78 MiB (10.39x wire) ->  ~0.001 MiB

The isolation it bought only ever needed to contain TOP-LEVEL SCALAR writes. The full
mutation surface on this path is two assignments:

  combo.ts     bodyRecord.max_tokens = ...   (reasoning buffer)
  chatCore.ts  body.model = model            (Background Task Redirection T41)

Nothing mutates the nested payload; applyCompression and injectUniversalHandoffBody both
return new objects (verified empirically -- neither touches its input, and both tolerate a
frozen one). So a fresh top-level object per target gives identical isolation while sharing
the expensive messages/tools arrays.

Also fixes a REAL cross-target leak in handleRoundRobinCombo. It already used a shallow
copy, but took it only when the reasoning buffer actually changed max_tokens -- every other
attempt shared the caller's object outright. The new test reproduces it on the unmodified
code: target 2 received model "mutated-by-openai/gpt-4o-mini". In production that is a
Background Task Redirection on one round-robin target rewriting body.model for the next.
The copy is now unconditional.

The invariant is pinned by tests rather than by a comment listing mutation sites, so the
clone strategy can change again without anyone re-deriving them by hand:
 - a target's in-place write must not leak into the next (priority / fill-first /
   round-robin; the stub reproduces chatCore's body.model write)
 - the caller's body is never mutated
 - the per-target copy stays shallow (targets share one messages array)
 - freeze probe: combo's own body handling performs no in-place writes

* test(sse): register the combo attempt-body isolation test in stryker tap.testFiles

The new test resets the circuit breaker in beforeEach, so it counts as a covering test
for src/shared/utils/circuitBreaker.ts. Without registering it,
check:mutation-test-coverage --strict reported a 4th drift entry that was not there on the
pristine tip -- new drift introduced by this PR. Registered in sorted position; the gate is
back to the 3 pre-existing entries (accountFallback.ts, error.ts, comboPredicates.ts) that
#8538 addresses.
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…unit tests in stryker tap.testFiles (cheaper-inference#8538)

* test(sse): register cheaper-inference#8396 and cheaper-inference#8376 unit tests in stryker tap.testFiles

check:mutation-test-coverage fails on release/v3.8.49 at its own HEAD:
two unit tests cover mutated modules but are absent from tap.testFiles,
so their mutant kills do not count and the drift gate blocks every
PR->release run.

- tests/unit/8396-cooldown-429-cap.test.ts covers
  open-sse/services/accountFallback.ts (imports checkFallbackError)
- tests/unit/8376-econnrefused-breaker.test.ts covers
  open-sse/services/combo/comboPredicates.ts (imports
  shouldRecordProviderBreakerFailure)

Both inserted in the array's existing sorted position; no other key
touched.

* test(sse): register repro-7503-no-choices in stryker tap.testFiles
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…-inference#7847) (cheaper-inference#8553)

* fix(sse): shallow per-target copy for the combo attempt body (cheaper-inference#7847)

combo.ts deep-cloned the request body for every target. On a 3.05 MiB agent request that
is 9.53 MiB at 3 targets, and it scales linearly:

  3 targets    9.53 MiB (3.12x wire)  ->  ~0.001 MiB
  5 targets   15.89 MiB (5.19x wire)  ->  ~0.000 MiB
 10 targets   31.78 MiB (10.39x wire) ->  ~0.001 MiB

The isolation it bought only ever needed to contain TOP-LEVEL SCALAR writes. The full
mutation surface on this path is two assignments:

  combo.ts     bodyRecord.max_tokens = ...   (reasoning buffer)
  chatCore.ts  body.model = model            (Background Task Redirection T41)

Nothing mutates the nested payload; applyCompression and injectUniversalHandoffBody both
return new objects (verified empirically -- neither touches its input, and both tolerate a
frozen one). So a fresh top-level object per target gives identical isolation while sharing
the expensive messages/tools arrays.

Also fixes a REAL cross-target leak in handleRoundRobinCombo. It already used a shallow
copy, but took it only when the reasoning buffer actually changed max_tokens -- every other
attempt shared the caller's object outright. The new test reproduces it on the unmodified
code: target 2 received model "mutated-by-openai/gpt-4o-mini". In production that is a
Background Task Redirection on one round-robin target rewriting body.model for the next.
The copy is now unconditional.

The invariant is pinned by tests rather than by a comment listing mutation sites, so the
clone strategy can change again without anyone re-deriving them by hand:
 - a target's in-place write must not leak into the next (priority / fill-first /
   round-robin; the stub reproduces chatCore's body.model write)
 - the caller's body is never mutated
 - the per-target copy stays shallow (targets share one messages array)
 - freeze probe: combo's own body handling performs no in-place writes

* test(sse): register the combo attempt-body isolation test in stryker tap.testFiles

The new test resets the circuit breaker in beforeEach, so it counts as a covering test
for src/shared/utils/circuitBreaker.ts. Without registering it,
check:mutation-test-coverage --strict reported a 4th drift entry that was not there on the
pristine tip -- new drift introduced by this PR. Registered in sorted position; the gate is
back to the 3 pre-existing entries (accountFallback.ts, error.ts, comboPredicates.ts) that
cheaper-inference#8538 addresses.
@MumuTW
MumuTW deleted the fix/stryker-register-8396-8376-tests branch September 5, 2026 10:19
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…unit tests in stryker tap.testFiles (cheaper-inference#8538)

* test(sse): register cheaper-inference#8396 and cheaper-inference#8376 unit tests in stryker tap.testFiles

check:mutation-test-coverage fails on release/v3.8.49 at its own HEAD:
two unit tests cover mutated modules but are absent from tap.testFiles,
so their mutant kills do not count and the drift gate blocks every
PR->release run.

- tests/unit/8396-cooldown-429-cap.test.ts covers
  open-sse/services/accountFallback.ts (imports checkFallbackError)
- tests/unit/8376-econnrefused-breaker.test.ts covers
  open-sse/services/combo/comboPredicates.ts (imports
  shouldRecordProviderBreakerFailure)

Both inserted in the array's existing sorted position; no other key
touched.

* test(sse): register repro-7503-no-choices in stryker tap.testFiles
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…-inference#7847) (cheaper-inference#8553)

* fix(sse): shallow per-target copy for the combo attempt body (cheaper-inference#7847)

combo.ts deep-cloned the request body for every target. On a 3.05 MiB agent request that
is 9.53 MiB at 3 targets, and it scales linearly:

  3 targets    9.53 MiB (3.12x wire)  ->  ~0.001 MiB
  5 targets   15.89 MiB (5.19x wire)  ->  ~0.000 MiB
 10 targets   31.78 MiB (10.39x wire) ->  ~0.001 MiB

The isolation it bought only ever needed to contain TOP-LEVEL SCALAR writes. The full
mutation surface on this path is two assignments:

  combo.ts     bodyRecord.max_tokens = ...   (reasoning buffer)
  chatCore.ts  body.model = model            (Background Task Redirection T41)

Nothing mutates the nested payload; applyCompression and injectUniversalHandoffBody both
return new objects (verified empirically -- neither touches its input, and both tolerate a
frozen one). So a fresh top-level object per target gives identical isolation while sharing
the expensive messages/tools arrays.

Also fixes a REAL cross-target leak in handleRoundRobinCombo. It already used a shallow
copy, but took it only when the reasoning buffer actually changed max_tokens -- every other
attempt shared the caller's object outright. The new test reproduces it on the unmodified
code: target 2 received model "mutated-by-openai/gpt-4o-mini". In production that is a
Background Task Redirection on one round-robin target rewriting body.model for the next.
The copy is now unconditional.

The invariant is pinned by tests rather than by a comment listing mutation sites, so the
clone strategy can change again without anyone re-deriving them by hand:
 - a target's in-place write must not leak into the next (priority / fill-first /
   round-robin; the stub reproduces chatCore's body.model write)
 - the caller's body is never mutated
 - the per-target copy stays shallow (targets share one messages array)
 - freeze probe: combo's own body handling performs no in-place writes

* test(sse): register the combo attempt-body isolation test in stryker tap.testFiles

The new test resets the circuit breaker in beforeEach, so it counts as a covering test
for src/shared/utils/circuitBreaker.ts. Without registering it,
check:mutation-test-coverage --strict reported a 4th drift entry that was not there on the
pristine tip -- new drift introduced by this PR. Registered in sorted position; the gate is
back to the 3 pre-existing entries (accountFallback.ts, error.ts, comboPredicates.ts) that
cheaper-inference#8538 addresses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants