spark-server: avoid orphan tool messages in F32#105
Open
lesserevil wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
F32 no longer clones an old failed
role: toolmessage onto the end of the conversation. It now surfaces the failed tool result in a runtime reminder, preserving OpenAI tool-message ordering so MiniMax and other vendor templates do not reject the prompt as an orphan tool result.Test plan
cargo fmt --all -- --checkLIBRARY_PATH=/opt/vllm/nccl-blackwell/lib LD_LIBRARY_PATH=/opt/vllm/nccl-blackwell/lib ATLAS_SKIP_BUILD=1 cargo test -p spark-server f32 -- --nocaptureLIBRARY_PATH=/opt/vllm/nccl-blackwell/lib LD_LIBRARY_PATH=/opt/vllm/nccl-blackwell/lib ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy -p spark-server --tests -- -DwarningsATLAS_SKIP_BUILD=1 cargo clippy --workspace --tests --all-features -- -Dwarningsstill fails on this Linux host before this patch because the workspace pullsobjc2, which requires an Apple target.bash scripts/check-license-headers.shcould not run becausescripts/check-license-headers.shis not present in this checkout.typoscould not run becausetyposis not installed on this host.nvidia/MiniMax-M2.7-NVFP4EP=2; a synthetic F32 regression request now returns HTTP 200 and logsF32: surfaced most-recent failed tool_result in a runtime reminder; Hermes smoke test no longer hits the MiniMax template 400.Notes for reviewers
The previous F32 behavior attempted to make a stale failure fresh by duplicating the original tool result. That creates invalid OpenAI history whenever messages after the original assistant/tool pair are not assistant tool calls, and MiniMax's template rejects it with "Message has tool role, but there was no previous assistant message with a tool call".
This keeps the guard's intent while staying inside the template contract: the stale failure is copied into a system-reminder appended to the latest user/tool message instead of being represented as a new
role: toolturn.Benchmarks: not run; this is a prompt-history correctness fix, not a performance-oriented change.
Authorship: AI-generated by Codex under human operator direction; no human-written code sections are claimed.
CLA