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

Đang mở
#49 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, go, json, python
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C#
Star
24
Fork
16
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/experimental-ext-interceptors

Tất cả issue của modelcontextprotocol/experimental-ext-interceptors

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.