litellm/tests/test_litellm/llms/fireworks_ai
mateo-berri da2e1ff619 fix(fireworks): fold system and developer items into instructions on the responses path
Fireworks renders a Responses request through a chat template that only
accepts a system message at the very beginning, so a request carrying
`instructions`, a developer item, and a replayed reasoning item (the shape
Codex CLI sends from its second prompt on) came back 400 with "System
message must be at the beginning".

The leading system or developer items, and any developer item later in
the conversation, now fold their text into top-level `instructions`,
joined with blank lines, and leave `input`. A developer item that closes
the conversation right after an assistant turn stays where it is as a
system item, as does any system or developer item with an image or file
part, so those parts still reach Fireworks. Mid-conversation system items
stay untouched. Non-string `instructions` pass through unchanged.

Folding into `instructions` rather than a leading system item keeps
`previous_response_id` chaining working, since Fireworks prepends the
stored history to `input` and a leading system item would land after it.
This supersedes the leading system item approach from deaadc21d3 and
4807630c2a on this branch. The leading and closing block rules match the
chat path change in #39852.
2026-09-08 12:12:34 -07:00
..
chat test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
completion test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
rerank test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
responses fix(fireworks): fold system and developer items into instructions on the responses path 2026-09-08 12:12:34 -07:00
test_fireworks_ai_common_utils.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_fireworks_ai_cost_calculator.py test(cost): type the off-peak fixture helpers with OffPeakPricing 2026-09-03 15:03:10 -07:00
test_fireworks_ai_kimi_model_metadata.py test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00