Repository navigation
Replies: 2 comments
|
This pagination fix is still necessary for existing/legacy large logs. There is also a deployable prevention layer for new tool output: dsh plugin --profile web add pi2dsh@0.11.0
dsh plugin --profile web add pi-quiet-tools@0.2.0Repository and compatibility evidence: https://github.com/weijiafu14/pi2dsh The distinction matters: byte-budget pagination bounds the response for a history that is already large; pre-history result offloading reduces future log growth and model-context cost. It does not eliminate the need for the one-oversized-group rule, cold-log work bounds, or history API pagination proposed here. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
The history API limits pages by message count, not response size. A small number of messages with large tool output can therefore serialize into multi-megabyte JSON responses. Over public or slow connections, this can time out or be aborted by the client while loading session history.
Proposed solution
Apply a UTF-8 response-byte budget when constructing history pages. The proposed default is 256 KiB, configurable as
historyPageMaxBytes. The page should end before the next complete message group would exceed the budget; tool calls and related output stay together. If the newest group alone is larger than the budget, return it on its own so the client can always advance.Implemented reference
I have implemented and validated this approach in a fork branch:
Validation included focused Vitest tests (43 tests), build/type checks, lint, and doc-sync. In a public smoke test on an affected session, the first page was 117,781 bytes with
hasMore=true, instead of an approximately 10 MB response.The contribution guide says external PRs are not accepted, so I am sharing the reference implementation here for discussion.
All reactions