Skip to content

fix(LiteLlm): recognize assistant- prefix as valid OpenAI file ID#5758

Open
nileshpatil6 wants to merge 2 commits into
google:mainfrom
nileshpatil6:fix/lite-llm-assistant-file-id-prefix
Open

fix(LiteLlm): recognize assistant- prefix as valid OpenAI file ID#5758
nileshpatil6 wants to merge 2 commits into
google:mainfrom
nileshpatil6:fix/lite-llm-assistant-file-id-prefix

Conversation

@nileshpatil6
Copy link
Copy Markdown

Azure OpenAI files uploaded with purpose=\"assistants\" receive IDs with an assistant- prefix (e.g. assistant-abc123). _looks_like_openai_file_id only checked for the file- prefix, causing Azure PDF attachments to be silently dropped from requests instead of being routed through the Responses API content block.

Fix: extend the startswith check to include \"assistant-\".

Also updated _redact_file_uri_for_log to return assistant-<redacted> for assistant- prefixed IDs, consistent with how file- IDs are handled.

Fixes #5664

@adk-bot adk-bot added the models [Component] Issues related to model support label May 20, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 20, 2026

Response from ADK Triaging Agent

Hello @nileshpatil6, thank you for creating this PR to fix the Azure OpenAI assistant prefix issue!

To help our reviewers process this contribution more efficiently and maintain code quality, could you please address the following items from our Contribution Guidelines:

  1. Unit Tests / Testing Plan:
    • Please add or update unit tests to cover this new file ID prefix (assistant-) and verify that redaction behaves correctly under tests/unittests/.
    • Please include a testing plan section in your PR description detailing how you verified the changes (such as a summary of passed pytest results).
  2. Logs or Screenshots:
    • As this is a bug fix, please provide logs or verification output showing how the file is successfully handled now compared to before.

These details will help ensure we prevent regressions and streamline the review process. Thank you again for your contribution!

@rohityan rohityan self-assigned this May 20, 2026
@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label May 20, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @nileshpatil6 , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing unit tests before we can proceed with the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] Issues related to model support request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title LiteLlm: Azure OpenAI file_id with assistant- prefix bypasses Responses-API content block

3 participants