fix handling of ResponseApplyPatchToolCall in completion bridge - #20913
Merged
13 commits merged intoFeb 18, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jtsaw
marked this pull request as ready for review
February 11, 2026 01:56
Contributor
Greptile OverviewGreptile SummaryFixes a bug where
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| litellm/completion_extras/litellm_responses_transformation/transformation.py | Adds handling for ResponseApplyPatchToolCall in _convert_response_output_to_choices, converting it to a ChatCompletions-style tool call with name="apply_patch" and the operation serialized as JSON. Clean implementation following the existing pattern for ResponseFunctionToolCall. Minor whitespace cleanup. |
| tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_transformation.py | Adds a comprehensive regression test for the ResponseApplyPatchToolCall conversion. Uses only mocks — no real network calls. Verifies the tool call structure, operation serialization, and finish reason. Also includes minor whitespace normalization in existing tests. |
Contributor
|
@Sameerlite can you take a look at this when you get a chance? |
Sameerlite
suggested changes
Feb 12, 2026
| # The operation (create_file / update_file / delete_file) is | ||
| # serialised as JSON so it appears in function.arguments, just | ||
| # like any other tool call. | ||
| operation_dict = item.operation.model_dump() |
Contributor
There was a problem hiding this comment.
Add this in as a method in LiteLLMCompletionResponsesConfig and use it here.
|
@jtsaw can you fix the linting error? |
jtsaw
force-pushed
the
fix/completion-bridge-apply-patch-tool-call
branch
from
February 13, 2026 00:56
b111a4e to
c7bc025
Compare
Contributor
Author
actually I'm not sure how to fix these lint errors...
@krrishdholakia |
ghost
merged commit Feb 18, 2026
8d5db4f
into
BerriAI:litellm_oss_staging_02_18_2026
5 of 18 checks passed
2 tasks
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
…iAI#20913) * fix handling of ResponseApplyPatchToolCall in completion bridge * refactor * style: fix black formatting * fix: clean up lint errors in test file (unused imports, print statements, formatting) * refactor: extract _map_optional_params_to_responses_api to fix PLR0915 * what * this linter cannot be me * revert cause idk what's going on * weird * idk why this got removed * revert more stuff * revert pt 3
This pull request was closed.
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.
Relevant issues
Fixes #20905
CI failures seem unrelated to my changes..
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes