Fix truncation of evaluation requests larger than 4 KB - #17
Open
peterbjohnson wants to merge 1 commit into
Open
Conversation
The pinned lf_toolkit commit read at most `size` bytes from the socket instead of reading to the newline delimiter, so any request longer than the 4096-byte read hint arrived truncated. The worker could not decode it and never replied, and Shimmy returned a 500 after its 30 second deadline. Any submission over roughly 45 notes was affected. The platform sends `response` and `answer` as JSON, so most real pieces exceeded the limit. Upstream fixed the framing in toolkit-python#10. Update the lock to pick it up, and add regression tests in transport_test.py that push a payload past the read hint so a future pin cannot reintroduce the bug. Verified against the container: a 200-note request (18.8 KB) now returns in 0.12 s, where it previously timed out after 30 s. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
peterbjohnson
force-pushed
the
toolkit_large_payload_fix
branch
from
September 9, 2026 20:39
8f9ce49 to
6278345
Compare
This was referenced Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11
Problem
The pinned
lf_toolkitcommit (8a687d3, 29 Jul 2026) read at mostsizebytes from the socket instead of reading to the newline delimiter:Any request longer than the 4096-byte read hint arrived truncated. The worker could not decode the partial JSON, never replied, and Shimmy returned a 500 after its 30 second deadline.
Roughly 45 notes was the practical limit. The platform sends
responseandansweras JSON, so most real pieces exceeded it. This affected the deployed staging function.Approach
Tests first.
evaluation_function/transport_test.pydrives lf_toolkit's newline framing directly with a payload either side of the read hint, using an in-memory stand-in for the socket that can return short reads.Against the previously pinned toolkit the new tests fail exactly at the boundary:
The short-payload control passes throughout, which is why the existing suite never caught this.
These tests live in their own file rather than in
evaluation_test.pybecause they do not exercise this repository's code at all. They assert that the transport underneath us delivers a whole request, which is a deployment contract rather than pipeline logic.Change
poetry update lf_toolkit, picking up the upstream fix in lambda-feedback/toolkit-python#10 (19 Aug 2026). No source changes in this repo. The three new tests are the regression guard, so a future pin cannot silently reintroduce it.Verification
Before the bump that same request returned HTTP 500 after 30 s.
🤖 Generated with Claude Code