You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Requests to rec without a Content-Length fail with 400 on an int(None) attempt #34
Requests to rec-served flint fail for streamed requests without a Content-Length, as (for example) envoy might do when streaming bodies through external processing which converts to Transfer-Encoding: chunked. Such a request fails without an intermediary though and is directly reproducible. In other words, middleware between clients and rec may break rec's ability to handle the request.
Steps to reproduce
With a running rec server instance,
% rec status
● flint is running http://127.0.0.1:11500/v1
Context 262,144 tokens · rec 0.1.0
query as
% curl -s http://127.0.0.1:11500/v1/chat/completions \
-H "Authorization: Bearer $( rec auth token )" \
-H 'Content-Type: application/json' \
-H 'Transfer-Encoding: chunked' \
-d '{"model":"flint","messages":[{"role":"user","content":"hi"}],"max_tokens":8}'
{"error": "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'"}
This likely comes from do_POST in the Handler casting int() on a header value that can be missing/None.
Output
As above
{"error": "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'"}
for any request without a Content-Length, like a streamed request.
Environment
Mac Tahoe 26.5.1, 48GB
% sysctl -n machdep.cpu.brand_string hw.memsize
Apple M5 Max
51539607552
% rec --version
rec 0.1.0
I removed API keys, tokens, and private content from this report.
changed the title [-]Requests to rec with a Content-Length fail with 400 on an int(None) attempt[/-][+]Requests to rec without a Content-Length fail with 400 on an int(None) attempt[/+]on Oct 26, 2026
Thanks for the clear reproduction. I reproduced the missing Content-Length failure and opened #51 to accept bounded chunked bodies on both OpenAI and Anthropic routes, including streaming responses. The focused suite passed 44 tests and covers malformed/ambiguous framing and admission cleanup. It is still a proposed fix, not part of a release yet.
Activity
[-]Requests to rec with a Content-Length fail with 400 on an int(None) attempt[/-][+]Requests to rec without a Content-Length fail with 400 on an int(None) attempt[/+]strin commentedon Nov 5, 2026
Thanks for the clear reproduction. I reproduced the missing Content-Length failure and opened #51 to accept bounded chunked bodies on both OpenAI and Anthropic routes, including streaming responses. The focused suite passed 44 tests and covers malformed/ambiguous framing and admission cleanup. It is still a proposed fix, not part of a release yet.