Skip to content

fix(ui): URL-encode team_id in teamInfoCall to handle special characters - #27466

Merged
ishaan-berri merged 1 commit into
BerriAI:litellm_internal_stagingfrom
SHARP155:sharp155-fix-teaminfo-call-ui-api
May 8, 2026
Merged

fix(ui): URL-encode team_id in teamInfoCall to handle special characters#27466
ishaan-berri merged 1 commit into
BerriAI:litellm_internal_stagingfrom
SHARP155:sharp155-fix-teaminfo-call-ui-api

Conversation

@SHARP155

@SHARP155 SHARP155 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

team_id with special characters in it fails with 404 error

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • 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

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

UI Change for updating the FE API call

image (17)

🐛 Bug Fix

Changes

malformed URLs from raw concatenation; team IDs with reserved chars produced wrong server-side lookups.

@CLAassistant

CLAassistant commented May 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug in teamInfoCall where team_id values containing special characters (spaces, &, ?, etc.) were appended raw to the query string, corrupting the URL. The fix wraps the value with encodeURIComponent, and two mock-based tests are added to verify both the encoding behaviour and the null-teamID code path.

  • networking.tsx: Single-line change replacing ?team_id=${teamID} with ?team_id=${encodeURIComponent(teamID)} in teamInfoCall.
  • networking.test.ts: New describe(\"teamInfoCall\") block with two tests — one round-trip URL-encoding check and one asserting no team_id param when the argument is null.

Confidence Score: 4/5

Safe to merge — the change is a single-line fix to encode a query parameter value, and the new tests validate both the encoding and the null-team-ID path using proper mocks.

The code change is correct and well-targeted. The PR description does not reference or link the issue being fixed, nor does it include a screenshot or repro trace as the template requires, making it harder to trace context after the fact.

No files require special attention; both changed files are straightforward.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/networking.tsx Correct minimal fix: encodeURIComponent applied to team_id query param value in teamInfoCall.
ui/litellm-dashboard/src/components/networking.test.ts Two new mock-based tests added for teamInfoCall; use vi.fn() mocks with proper setup/teardown and no real network calls.

Reviews (1): Last reviewed commit: "fix(ui): URL-encode team_id in teamInfoC..." | Re-trigger Greptile

@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ishaan-berri
ishaan-berri merged commit 144279e into BerriAI:litellm_internal_staging May 8, 2026
42 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
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.

4 participants