Skip to content
TheChatArchiveThe Chat Archive
fable-5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Fail on HTTP Status 204 (No Content) Hello, I'm using Synadia Cloud which has a DELETE…

  1. User

    Fail on HTTP Status 204 (No Content) Hello,

    I'm using Synadia Cloud which has a DELETE API that returns a response with no body.

    $ restish synadia delete-nats-user --help
    
      Deletes a NATS user from an account
    
      ## Argument Schema:
    
        {
          user-id: (string)
        }
    
      ## Responses 204/400/401/403/404
    
      Response has no body
    

    In this case, it's expected to have an empty body. Nevertheless, restish fails with the error:

    ERROR: Parse response error
    ERROR: Caught error: EOF
    

    Here is the full log:

    DEBUG: API loading took 6.245709ms
    DEBUG: Configuration: [REDACTED]
    DEBUG: Adding TLS configuration
    DEBUG: Making request:
    DELETE /api/core/beta/nats-users/[REDACTED] HTTP/1.1
    Host: cloud.synadia.com
    Accept: application/msgpack;q=0.8,application/cbor;q=0.9,application/ion;q=0.6,application/json;q=0.5,application/yaml;q=0.5,text/*;q=0.2,*/*
    Accept-Encoding: deflate, gzip, br
    Authorization: [REDACTED]
    User-Agent: restish-0.20.0
    
    
    DEBUG: Got response from server in 426.428041ms:
    HTTP/2.0 204 No Content
    Content-Encoding: gzip
    Date: Mon, 26 May 2025 19:48:15 GMT
    Set-Cookie: [REDACTED]
    Strict-Transport-Security: max-age=15768000 ; includeSubDomains
    Vary: Accept-Encoding
    X-Content-Type-Options: nosniff
    X-Frame-Options: SAMEORIGIN
    
    
    DEBUG: Decoding response from gzip
    ERROR: Parse response error
    ERROR: Caught error: EOF
    DEBUG: goroutine 1 [running]:
    runtime/debug.Stack()
            /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/debug/stack.go:24 +0x68
    github.com/danielgtaylor/restish/cli.Run.func1()
            /home/runner/work/restish/restish/cli/cli.go:849 +0x68
    panic({0x1051c4f40, 0x140001900f0})
            /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/panic.go:838 +0x204
    github.com/danielgtaylor/restish/cli.MakeRequestAndFormat(0x1052d4830?)
            /home/runner/work/restish/restish/cli/request.go:568 +0x118
    github.com/danielgtaylor/restish/cli.Operation.command.func1(0x14000693800?, {0x1400061e8a0, 0x1, 0x2})
            /home/runner/work/restish/restish/cli/operation.go:142 +0x814
    github.com/spf13/cobra.(*Command).execute(0x14000693800, {0x1400061e880, 0x2, 0x2})
            /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x5dc
    github.com/spf13/cobra.(*Command).ExecuteC(0x1400034e600)
            /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x35c
    github.com/spf13/cobra.(*Command).Execute(...)
            /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
    github.com/danielgtaylor/restish/cli.Run()
            /home/runner/work/restish/restish/cli/cli.go:857 +0x9a8
    main.main()
            /home/runner/work/restish/restish/main.go:40 +0x370
    

    Interface

    No new interfaces are introduced.

  2. Assistant

    Now add a regression test alongside the existing decompression tests:

  3. Assistant

    Let me verify the test actually fails without the fix:

  4. Assistant

    Confirmed — without the fix, the test reproduces the exact reported error (decompressing response: EOF). Now run the full suite:

  5. Assistant

    All tests pass, including the full integration suite. Summary of the fix:

    Problem

    A 204 No Content response carrying a Content-Encoding: gzip header (as Synadia Cloud sends) crashed with Parse response error / EOF — gzip.NewReader fails with EOF when handed an empty body.

    Fix

    internal/content/registry.go — Registry.Decompress now peeks at the body before wrapping it with a decoder. If the body is empty (Peek(1) returns io.EOF), it returns the empty reader as-is instead of decoding. This covers all encodings (gzip, deflate, br) and all call sites (internal/cli/http.go, internal/output/response.go), since decompression funnels through this one method.

    Tests

    • internal/content/registry_test.go — TestDecompressEmptyBody covers empty bodies for all three built-in encodings.
    • internal/cli/http_test.go — TestHTTPNoContentWithContentEncoding, an end-to-end regression test replicating the reported scenario (DELETE → 204 + Content-Encoding: gzip + empty body). Verified it fails with the exact reported error (decompressing response: EOF) when the fix is stashed, and passes with it.

    go test ./... and go test -tags=integration ./... both pass clean.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.