Repository navigation
Commit 8d1d1e4
committed
test(api): pin the cache-key gate on the streaming path and SDK defaults
What:
- openai-native-usage.spec.ts: add a createMessage test with codex-mini-latest
and a task id, asserting the SDK request body omits prompt_cache_key. The
spec now stubs the openai client so the public entry point is drivable.
- openai-native.spec.ts: extend the SDK-path header test to also assert the
OpenAI constructor's defaultHeaders carry neither session_id nor
prompt_cache_key.
Why:
Both existing assertions stopped one level short of the surface that ships.
The builder-level model-gate test cannot see createMessage, which forwards
metadata into buildRequestBody, so a key injected anywhere along that path
still passed. The per-request header assertion cannot see defaultHeaders, so a
restored affinity header there would ship on every request while the test
stayed green. Each new assertion was proven to fail against a mutant that
plants exactly the value it forbids (streaming-path key injection; session_id
and prompt_cache_key in defaultHeaders), and each mutant was killed by the new
assertion alone.
Impact:
Test-only. Zero production lines; prompt_cache_key semantics unchanged. No new
ESLint suppressions, no changeset.1 parent 54504a2 commit 8d1d1e4
2 files changed
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
4 | 20 | | |
5 | 21 | | |
6 | 22 | | |
| |||
491 | 507 | | |
492 | 508 | | |
493 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
494 | 536 | | |
495 | 537 | | |
496 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1508 | 1508 | | |
1509 | 1509 | | |
1510 | 1510 | | |
| 1511 | + | |
1511 | 1512 | | |
1512 | 1513 | | |
1513 | 1514 | | |
| |||
1521 | 1522 | | |
1522 | 1523 | | |
1523 | 1524 | | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1524 | 1533 | | |
1525 | 1534 | | |
1526 | 1535 | | |
| |||
0 commit comments