mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 08:12:20 +03:00
fix(test): align emergency fallback budget-exhaustion test with #6912 max_tokens normalization (#6967)
The test asserted both max_tokens and max_completion_tokens=4096 on the
nvidia/openai/gpt-oss-120b emergency fallback request. Commit a34fb6b3e
(#6912, merged into this release tip) added a symmetric normalization in
chatCore.ts that renames/deletes the redundant max_completion_tokens field
whenever the target provider supportsMaxTokens() (nvidia does), so only
max_tokens reaches the upstream request. The old dual-field assertion is
an outdated contract, not a regression. Align the test to the new
intentional behavior while keeping the max_tokens=4096 cap assertion as
the fallback-cap guard.
This commit is contained in:
@@ -444,7 +444,10 @@ test("handleChat uses the emergency fallback model on budget exhaustion", async
|
||||
assert.equal(seenBodies.length, 2);
|
||||
assert.equal(seenBodies[1].model, "openai/gpt-oss-120b");
|
||||
assert.equal(seenBodies[1].max_tokens, 4096);
|
||||
assert.equal(seenBodies[1].max_completion_tokens, 4096);
|
||||
// nvidia supports the legacy `max_tokens` field (#6912 symmetric normalization in
|
||||
// chatCore.ts), so the redundant `max_completion_tokens` is renamed away rather than
|
||||
// sent alongside it — only one output-token field reaches the upstream request.
|
||||
assert.equal(seenBodies[1].max_completion_tokens, undefined);
|
||||
assert.equal(json.choices[0].message.content, "Emergency fallback answered");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user