Repository navigation
fix: Hugging Face output items yield a tool-result - #306
Closed
cunninghamcard-bit wants to merge 1 commit into
Closed
cunninghamcard-bit wants to merge 1 commit into
cunninghamcard-bit wants to merge 1 commit into
Conversation
…ggingface@2.0.62 doGenerate pushes a tool-result after a function_call or mcp_call when part.output is truthy, with the output string as the result (huggingface-responses-language-model.ts:273, :312). aimux dropped the function_call output and, for mcp_call, also gave a tool-result for an empty string. Both now follow `if (part.output)`, and so does the stream's function_call (:489). Tests: should_handle_function_call_tool_responses now expects the tool-result; mcp_call_with_empty_output_has_no_tool_result is new (tests/huggingface_responses_test.rs). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
7 of 12 tasks
cunninghamcard-bit
added a commit
that referenced
this pull request
Oct 20, 2026
The three behaviour fixes now live in their own PRs (#305, #306, #307); this branch stacks on the last one. responses.rs and CHANGELOG.md are the same on both sides; the old test file keeps the markers and takes the two aimux tests the fix PRs added. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
This was referenced Oct 20, 2026
Contributor
Author
|
Folded into #307 together with the other Hugging Face fixes, so each vendor has one fix PR. This change is commit Generated by Claude Code |
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
Before: a non-streaming Hugging Face
function_callitem with anoutputgave only the tool-call; the output was dropped. Anmcp_callwhoseoutputwas an empty string still gave a tool-result.After: both follow upstream's
if (part.output): a non-emptyoutputstring adds a tool-result holding that string, an empty or missing one adds nothing. The stream'sfunction_calluses the same check.Found while porting the upstream Hugging Face tests (#303, case
tool calls › should handle function call tool responses). Part of the #276 list. Stacked on #305 (CHANGELOG lines touch); the stream-error PR follows.How it works today
What this PR changes
Tests (
tests/huggingface_responses_test.rs):should_handle_function_call_tool_responsesasserted the dropped output; it now expects tool-call, tool-result, text.mcp_call_with_empty_output_has_no_tool_resultis new. The full upstream case is in #303.Docs: CHANGELOG
Fixed.Type of change
Checklist
cargo +1.99 fmt -p aimux-providers -- --checkpassescargo +1.99 clippy -p aimux-providers --lib --tests -- -D warningspassescargo +1.99 test -p aimux-providers --test huggingface_responses_testpasses (33)scripts/check_provider_boundaries.shpassesNotes for reviewers
The
mcp_callresult is now always the output string (upstream'sresult: part.output); before, a non-string JSON output was passed through as is.Generated by Claude Code