SEP: say whether `durationMs` and `timeoutMs` are integers; SDKs disagree and do not interoperate

オープン
#49 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, go, json, python

調査の方向性

The mismatch lives in the SEP text at docs/sep.md (the durationMs and timeoutMs field types and the timeoutMs: 5000 example) and in the SDK wire types: go/sdk/interceptors/wire.go and csharp/sdk/src/ModelContextProtocol.Interceptors/Protocol/InvokeInterceptorRequestParams.cs and InterceptorResult.cs. Reproduce by serializing a Python float such as 5000.0 into those C# types. Done means the maintainers pick one integer-or-number option, the SEP text states it, and the SDKs agree on it. Because this needs a spec decision first, it is not a good first code change.

索引モデルが issue の本文から書いたものです。

説明

The SEP types the millisecond fields as number (durationMs, timeoutMs), and every example uses whole numbers (for instance timeoutMs: 5000). The SDKs have read this differently, and the readings do not interoperate.

SDK timeoutMs durationMs
Go int64 int64
C# int? long?
Python (#30) float, sent as 5000.0 float, sent as e.g. 0.0072

Effect. System.Text.Json throws JsonException when it reads {"timeoutMs":5000.0} into int? or {"durationMs":0.0072} into long? (tested on .NET 10 with a class that uses the same field types). So a C# invoker cannot read any result from a Python interceptor server, and a C# server rejects any Python request that carries timeoutMs. Go's encoding/json is expected to reject the same values for int64; that was not run.

Options.

  1. Say in the SEP that both fields are integer milliseconds. This matches every example in the text and the Go and C# SDKs; Python would round on send.
  2. Keep number and say that fractional values are allowed. Go and C# would then need to accept them.

Either way, senders could emit integers and receivers could accept any JSON number, which would make the SDKs tolerant of each other regardless of which option is chosen.

Found while reviewing #30.

🤖 Generated with Claude Code

主要言語
C#
スター
24
フォーク
16
平均マージ
3分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/experimental-ext-interceptors のほかの issue

modelcontextprotocol/experimental-ext-interceptors の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。