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

Abierto
#49 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, go, json, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C#
Estrellas
24
Forks
16
Merge medio
3 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/experimental-ext-interceptors

Todos los issues de modelcontextprotocol/experimental-ext-interceptors

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.