Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

mcp: client returns an input_required result that has only requestState instead of retrying

Chiusa
#1,364 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1365 di @SergeevDmitry — integrata

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api

Direzione di ricerca

The early return is in clientMultiRoundTripMiddleware in mcp/mrtr.go, around lines 81-84, which exits when InputRequests is nil before checking the result type. Read that middleware and the MRTR section of client.md, then write a test where the server answers with an input_required result carrying only requestState. Done when ClientSession.CallTool retries with requestState echoed until NeedsInput() is false, and the existing MRTR tests still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What did you do?

Called a tool on a server that answers the first tools/call with an InputRequiredResult carrying only requestState:

{"resultType":"input_required","requestState":"continue"}

SEP-2322 allows this. Servers "MUST include at least one of inputRequests or requestState", and without inputRequests "the client MAY retry the original request immediately" (MRTR). The TypeScript SDK server sends such results from inputRequired({ requestState }).

What did you see?

ClientSession.CallTool returns that result to the caller (NeedsInput() is true, no content), with the multi-round-trip middleware enabled. clientMultiRoundTripMiddleware returns as soon as InputRequests is nil, before it looks at the result type (mrtr.go L81-L84).

What did you expect to see?

The middleware retries the call with the requestState echoed. The client docs say it retries while NeedsInput() is true, "repeating until the result no longer needs input" (client.md). The TypeScript client retries these results as load-shedding rounds.

What version of the Go MCP SDK are you using?

main at 71fd646, also v1.8.0.

What version of Go are you using (go version)?

go1.27.1 darwin/arm64

I have a fix with tests and will open a PR.

AI assistance: I used Claude Code to help investigate this.

Lingua principale
Go
Stelle
5.2k
Fork
583
Merge medio
2g 1h
PR unite (30g)
55

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/go-sdk

Tutte le issue di modelcontextprotocol/go-sdk

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.