Skip to content

chore(release): backport #31393 to stable/1.89.x and cut 1.89.6 - #32001

Merged
yuneng-berri merged 4 commits into
stable/1.89.xfrom
litellm_backport_1_89_x_bp-mcp-log-31393
Jul 3, 2026
Merged

chore(release): backport #31393 to stable/1.89.x and cut 1.89.6#32001
yuneng-berri merged 4 commits into
stable/1.89.xfrom
litellm_backport_1_89_x_bp-mcp-log-31393

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

Relevant issues

Backports #31393 onto stable/1.89.x and cuts 1.89.6. The MCP client logged the full caller arguments at INFO on every call in call_tool and get_prompt, so tool-call input such as user queries, model names, and instructions landed in the proxy application logs and any downstream log aggregator. Both lines now log only the tool or prompt name and drop the arguments; the name is a stable identifier that is not sensitive, the input is what must not be logged

Linear ticket

LIT-3811

What is included

  • fix(mcp): stop logging tool-call input in MCP client #31393 fix(mcp): stop logging tool-call input in MCP client (cherry picked from 7acc015)
  • bump: version 1.89.5 -> 1.89.6
  • chore: refresh uv.lock for 1.89.6
  • chore(ci): sync GitHub Actions with default branch; this realigns only .github/workflows/ and .github/actions/ with the default branch so create-release can run, and carries no product code

Adaptation notes

The production change to litellm/experimental_mcp_client/client.py applied verbatim (patch-id identical). The mapped test file tests/test_litellm/experimental_mcp_client/test_mcp_client.py was ADAPTED: on staging the three log-redaction additions (_all_logged_messages, test_call_tool_does_not_log_arguments, test_get_prompt_does_not_log_arguments) were appended after a TestMCPClientResolvedAuth class that does not exist on 1.89.x (its resolved_auth MCPClient parameter predates this line). That neighbor class was excluded and the three tests appended after the line's last existing test class instead. The three added test functions are byte-identical to the source PR; a name-equality assert confirmed no staging-only neighbor tests were absorbed

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Known noise on this line

The mapped test file baseline on stable/1.89.x tip was 23 passed, 0 failures, so there is no pre-existing red to discount here. One pre-existing ruff F401 (import ssl unused, line 3 of the test file) exists on the line independent of this pick

Screenshots / Proof of Fix

Live proxy running this branch's code, calling the wikipedia MCP server's fetch tool at production INFO level. Same real tool call in both runs with a sentinel string in the arguments so it is grep-able

Before the fix (baseline on the line tip) the INFO line carries the full arguments and the input is grep-able

$ grep "MCP client calling tool 'fetch'" litellm.log
16:49:19 - LiteLLM:INFO: client.py:557 - MCP client calling tool 'fetch' with arguments: {'url': 'https://example.com', '_probe': 'LIT3811SECRETPROBE_BASE'}

$ grep -c "LIT3811SECRETPROBE_BASE" litellm.log
2

After the pick the same line logs only the tool name, and the input no longer appears anywhere in the logs, while the tool call still returns content (routing unaffected)

$ grep "MCP client calling tool 'fetch'" litellm.log
16:52:13 - LiteLLM:INFO: client.py:557 - MCP client calling tool 'fetch'

$ grep -c "LIT3811SECRETPROBE_POST" litellm.log
0

Targeted tests as a delta: baseline 23 passed on the line tip; with the pick applied 25 passed (the two new redaction tests), zero new failures. A behavioral gauntlet run (universal, standard) sealed SURVIVED across all three sub-claims (identifiers resolve, the pick's own tests deliver the redaction, no existing caller depends on the removed log substring), with zero verified regression findings

Type

🐛 Bug Fix

Changes

litellm/experimental_mcp_client/client.py: the two INFO log lines in call_tool and get_prompt now log only the tool or prompt name and drop the arguments. Plus the mapped regression tests that drive call_tool / get_prompt with a sensitive arguments value and assert it never reaches the logger (they fail on the pre-fix code and pass on the fix), the 1.89.6 version bump and lock refresh, and the GitHub Actions default-branch sync

ryan-crabbe-berri and others added 4 commits July 2, 2026 16:51
The MCP client logged the full tool arguments (and prompt arguments) at INFO on every call, so caller input such as user queries, model names, and instructions landed in the proxy application logs and any downstream log aggregator

Log only the tool or prompt name and drop the arguments from these INFO lines

(cherry picked from commit 7acc015)
@yuneng-berri
yuneng-berri requested a review from a team July 3, 2026 00:06
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This backport cherry-picks the log-redaction fix from #31393 onto the stable/1.89.x branch and cuts version 1.89.6. The only product-code change drops the arguments field from the two INFO log lines in call_tool and get_prompt in the MCP client, so tool-call inputs no longer appear in proxy application logs or downstream aggregators.

  • litellm/experimental_mcp_client/client.py: Both call_tool and get_prompt now log only the tool/prompt name at INFO level; the arguments dict that could contain user queries, model names, or other sensitive data is no longer emitted.
  • tests/test_litellm/experimental_mcp_client/test_mcp_client.py: Two new fully-mocked regression tests verify that a sentinel secret value never appears in any log call (info/debug/warning/error/exception) after the fix; the baseline test count grows from 23 to 25.
  • pyproject.toml: Version bumped from 1.89.5 to 1.89.6; remaining files are GitHub Actions sync and lock-file refresh with no product impact.

Confidence Score: 5/5

Safe to merge — the change is a two-line log redaction with no effect on routing, tool execution, or error handling.

The product-code diff is minimal: two f-strings in INFO log calls lose their arguments interpolation and nothing else changes. The fix does not touch any request path, session management, error handling, or return values. The two new tests are fully mocked, cover all standard log levels via _all_logged_messages, and fail on the pre-fix code by design. The GitHub Actions and lock-file changes carry no product logic.

No files require special attention.

Important Files Changed

Filename Overview
litellm/experimental_mcp_client/client.py Removes arguments from two INFO log calls in call_tool and get_prompt, fixing sensitive data leakage into proxy logs; no logic change.
tests/test_litellm/experimental_mcp_client/test_mcp_client.py Adds two new mock-only tests (test_call_tool_does_not_log_arguments, test_get_prompt_does_not_log_arguments) and helper _all_logged_messages; no real network calls, comprehensive log-level coverage.
pyproject.toml Version bumped from 1.89.5 to 1.89.6 in both [project] and [tool.commitizen] sections.

Reviews (1): Last reviewed commit: "chore(ci): sync GitHub Actions with defa..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri enabled auto-merge July 3, 2026 00:48
@yuneng-berri
yuneng-berri merged commit d57f8a9 into stable/1.89.x Jul 3, 2026
37 of 51 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_backport_1_89_x_bp-mcp-log-31393 branch July 3, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants