Skip to content

Fail pending Streamable HTTP requests on POST 405#145

Open
jstar0 wants to merge 1 commit into
patvice:mainfrom
jstar0:fix/streamable-http-post-405-error
Open

Fail pending Streamable HTTP requests on POST 405#145
jstar0 wants to merge 1 commit into
patvice:mainfrom
jstar0:fix/streamable-http-post-405-error

Conversation

@jstar0

@jstar0 jstar0 commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Fixes #144.

Fixes a Streamable HTTP edge case where a POST request with a JSON-RPC id could receive HTTP 405 immediately, but the caller would still wait until the request timeout.

Changes

  • Deliver POST 405 responses to the matching pending request queue as a TransportError.
  • Keep the existing lenient 405 behavior for non-waiting POSTs, SSE fallback, and session termination.
  • Add a regression test that proves a pending POST 405 fails fast instead of timing out.

Verification

bundle exec rspec spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb:2211
bundle exec rspec spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb:247 spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb:2174 spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb:2397
bundle exec rspec spec/ruby_llm/mcp/native/transports/streamable_http_spec.rb
bundle exec rake rubocop

@jstar0 jstar0 force-pushed the fix/streamable-http-post-405-error branch from d792bfe to 7cbdbd8 Compare June 20, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: StreamableHTTP: 405 response to a POST request is silently ignored, request hangs until timeout

1 participant