Skip to content

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

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara/933543436
Jun 17, 2026
Merged

fix(LiteLlm): recognize assistant- prefix as valid OpenAI file ID#6154
copybara-service[bot] merged 1 commit into
mainfrom
copybara/933543436

Conversation

@copybara-service

Copy link
Copy Markdown

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

Merge #5758

Original PR by @nileshpatil6 (Nilesh Patil 128893479+nileshpatil6@users.noreply.github.com)

Azure OpenAI files receive IDs with an assistant- prefix (e.g. assistant-abc123) or file- prefix. When _looks_like_openai_file_id recognizes an assistant- prefixed ID (e.g., assistant-abc123) or file- prefixed ID, _redact_file_uri_for_log defaulted to logging both as file - <redacted>.

Fix: refactor _redact_file_uri_for_log to dynamically extract file ID prefixes (file-, assistant-). This ensures compatibility with both current prefixes and future OpenAI/Azure file ID types.

Fixes #5664

Co-authored-by: Yi Liu yiliuly@google.com

Merge #5758

Original PR by @nileshpatil6 (Nilesh Patil <128893479+nileshpatil6@users.noreply.github.com>)

Azure OpenAI files receive IDs with an `assistant-` prefix (e.g. `assistant-abc123`) or `file-` prefix. When `_looks_like_openai_file_id` recognizes an `assistant-` prefixed ID (e.g., `assistant-abc123`) or `file-` prefixed ID, `_redact_file_uri_for_log` defaulted to logging both as `file - <redacted>`.

Fix: refactor `_redact_file_uri_for_log` to dynamically extract file ID prefixes (`file-`, `assistant-`). This ensures compatibility with both current prefixes and future OpenAI/Azure file ID types.

Fixes #5664

Co-authored-by: Yi Liu <yiliuly@google.com>
PiperOrigin-RevId: 933931477
@copybara-service copybara-service Bot force-pushed the copybara/933543436 branch from fcf187a to ea325c7 Compare June 17, 2026 21:40
@copybara-service copybara-service Bot merged commit ea325c7 into main Jun 17, 2026
@copybara-service copybara-service Bot deleted the copybara/933543436 branch June 17, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

1 participant