Skip to content

Fix #45: Add MCPConnectionErrorFilter for cleaner production logs - #73

Open
TensorDevLJ wants to merge 5 commits into
redhat-data-and-ai:deep-agentfrom
TensorDevLJ:feat/mcp-connection-error-filter
Open

Fix #45: Add MCPConnectionErrorFilter for cleaner production logs#73
TensorDevLJ wants to merge 5 commits into
redhat-data-and-ai:deep-agentfrom
TensorDevLJ:feat/mcp-connection-error-filter

Conversation

@TensorDevLJ

@TensorDevLJ TensorDevLJ commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • Add MCPConnectionErrorFilter to downgrade expected client disconnect errors (client disconnected, connection reset, broken pipe) from ERROR to DEBUG
  • Add ENABLE_MCP_CONNECTION_FILTER feature flag (default: True) to control filter attachment
  • Attach filter idempotently to mcp, uvicorn.error, and starlette loggers during app lifespan startup
  • Document the new setting in .env.example and docs/development.md

Fixes #45

Test plan

  • 314 tests passing
  • Unit tests cover pattern matching (all 3 patterns, case-insensitive, unexpected errors unchanged)
  • Unit tests cover filter attachment when enabled/disabled
  • Unit tests cover idempotent filter attachment

abhiskum and others added 4 commits June 1, 2026 10:31
…t-data-and-ai#22)

Signed-off-by: Abhishek Kumar <abhishek68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…roduction logs

Downgrade expected client disconnect errors from ERROR to DEBUG via a
feature-flagged logging filter, reducing production log noise without
hiding genuine application failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TensorDevLJ
TensorDevLJ changed the base branch from main to deep-agent July 15, 2026 06:55
Signed-off-by: Likhitha J <143345274+TensorDevLJ@users.noreply.github.com>
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.

Add MCPConnectionErrorFilter for cleaner production logs

2 participants