Skip to content

Suppress provider debug logs by default#143

Merged
mstolarzblaxelai merged 1 commit into
mainfrom
mstolarz/eng-2506-provider-log-hygiene
May 14, 2026
Merged

Suppress provider debug logs by default#143
mstolarzblaxelai merged 1 commit into
mainfrom
mstolarz/eng-2506-provider-log-hygiene

Conversation

@mstolarzblaxelai
Copy link
Copy Markdown
Contributor

@mstolarzblaxelai mstolarzblaxelai commented May 13, 2026

Summary

  • suppress high-risk provider debug loggers by default when sdk-python logging initializes
  • add BL_ALLOW_PROVIDER_DEBUG_LOGS=true as an explicit opt-in for trusted local debugging
  • re-apply suppression in the Google ADK/LiteLLM path before model creation and calls
  • add unit and Google ADK coverage for forced root DEBUG behavior

Verification

  • uv run ruff check .
  • uv run pytest tests/core/test_logger.py -q
  • BL_WORKSPACE=main uv run --locked --python 3.13 --extra googleadk --group test pytest tests/integration/googleadk/test_model.py -q
  • make test (213 passed)

Deployed proof

Fresh temp Google ADK agent deployed with a local SDK wheel and explicit LOG_LEVEL=DEBUG.

  • invocations: 13/13 succeeded
  • LLM Request: 0
  • Request options: 0
  • RAW RESPONSE: 0
  • X-Blaxel-Authorization: 0
  • authorization: 0
  • bearer: 0
  • JWT-like matches: 0

Temp agent was deleted and verified absent after the scan.

Linear: ENG-2506


Note

Suppresses a fixed list of provider loggers (LiteLLM, google-adk, httpx, openai, httpcore) to WARNING by default during init_logger and defensively re-applies suppression around every Google ADK model call. Opt-in via BL_ALLOW_PROVIDER_DEBUG_LOGS=true. Adds unit and integration test coverage.

Written by Mendral for commit 2c2f9e0.

mendral-app[bot]

This comment was marked as outdated.

@mstolarzblaxelai
Copy link
Copy Markdown
Contributor Author

CI note: the only red check is Integration Tests (livekit), and I verified it is unrelated to this PR.

The same LiveKit target fails on untouched origin/main at c65bea4 with the same error: sandbox-openai rejects reasoning_effort=minimal from the LiveKit path.

All checks relevant to this provider log hygiene change are green, including Google ADK, unit tests across Python 3.10-3.14, CodeQL, Cursor Security Reviewer, and Mendral.

I split the LiveKit compatibility issue into Linear ENG-2508 so this PR can stay focused on ENG-2506.

@mstolarzblaxelai mstolarzblaxelai force-pushed the mstolarz/eng-2506-provider-log-hygiene branch from ade2eca to 49b95b3 Compare May 14, 2026 01:25
mendral-app[bot]

This comment was marked as outdated.

@mstolarzblaxelai mstolarzblaxelai changed the base branch from main to mstolarz/eng-2508-livekit-reasoning-effort May 14, 2026 01:30
Base automatically changed from mstolarz/eng-2508-livekit-reasoning-effort to main May 14, 2026 18:13
@mstolarzblaxelai mstolarzblaxelai force-pushed the mstolarz/eng-2506-provider-log-hygiene branch from 49b95b3 to 2c2f9e0 Compare May 14, 2026 18:16
Copy link
Copy Markdown
Contributor

@mendral-app mendral-app Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Implementation is correct and secure. The suppression logic properly gates all attached handlers, the double suppress_provider_debug_loggers() call in init_logger correctly handles post-basicConfig state, and httpx retains its CRITICAL level because the guard condition won't downgrade it. No issues.

Tag @mendral-app with feedback or questions. View session

@mstolarzblaxelai mstolarzblaxelai merged commit 37e0477 into main May 14, 2026
30 of 31 checks passed
@mstolarzblaxelai mstolarzblaxelai deleted the mstolarz/eng-2506-provider-log-hygiene branch May 14, 2026 18:40
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