Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Code QA Fixes) - Use LoggingCallbackManager to ensure no dup callbacks are added #8070

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

ishaan-jaff
Copy link
Contributor

(Code QA Fixes) - Use LoggingCallbackManager to ensure no dup callbacks are added

Relevant issues

Type

πŸ†• New Feature
πŸ› Bug Fix
🧹 Refactoring
πŸ“– Documentation
πŸš„ Infrastructure
βœ… Test

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

If UI changes, send a screenshot/GIF of working UI fixes

Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
litellm βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jan 29, 2025 3:08am

parent_list.append(callback)
else:
verbose_logger.debug(
f"Callback {callback} already exists in {parent_list}, not adding again.."

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.

Copilot Autofix AI 6 days ago

To fix the problem, we should avoid logging sensitive information directly. Instead, we can log a generic message that does not include the sensitive data. This way, we maintain the logging functionality without exposing sensitive information.

  • Replace the logging statement that includes the sensitive callback data with a more generic message.
  • Specifically, change the logging statement in the _add_string_callback_to_list method in litellm/litellm_core_utils/logging_callback_manager.py.
Suggested changeset 1
litellm/litellm_core_utils/logging_callback_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/litellm/litellm_core_utils/logging_callback_manager.py b/litellm/litellm_core_utils/logging_callback_manager.py
--- a/litellm/litellm_core_utils/logging_callback_manager.py
+++ b/litellm/litellm_core_utils/logging_callback_manager.py
@@ -102,3 +102,3 @@
             verbose_logger.debug(
-                f"Callback {callback} already exists in {parent_list}, not adding again.."
+                "A callback already exists in the list, not adding again."
             )
EOF
@@ -102,3 +102,3 @@
verbose_logger.debug(
f"Callback {callback} already exists in {parent_list}, not adding again.."
"A callback already exists in the list, not adding again."
)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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.

1 participant