modelcontextprotocol / modelcontextprotocol/python-sdk
Improve exception tracebacks for easier debugging
オープン
まだ誰も着手していません。
enhancement
P2
v2
- 主要言語
- Python
- スター
- 24.3k
- フォーク
- 4k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 31
説明
Summary
Make exception tracebacks clearer and easier to understand by reducing asyncio/anyio wrapper noise.
Problem
- Exceptions are often wrapped in multiple layers of asyncio/anyio task group machinery
- Tracebacks are hard to read and don't clearly point to the root cause
- The
raise_exceptionflag is not consistently respected - Errors from deep inside task groups obscure the actual failure point
Goal
- Cleaner tracebacks that point to user code, not SDK internals
- Raise exceptions from the main context where possible
- Reduce nesting of exception wrappers
Related
- #743 - RuntimeError but the actual root cause is not logged correctly
- #396 - MCP Server: Inconsistent Exception Handling in @app.call_tool
- #1401 - ClientSession Error Handling
- #1742 - Introduce typed error classes with metadata
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue ではファイルもテストも特定されていません。まず asyncio/anyio のタスクグループの経路と raise_exception フラグのすべての使用箇所を追跡し、次にリンクされている例外処理関連の issue を確認してください。完了の条件は、traceback にユーザーレベルの失敗が現れ、wrapper のネストが減り、raise_exception が一貫して尊重されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100