]> git.giacomolli.uk - onechat/commit
Send the end of the view in one part with the task
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 20:04:29 +0000 (17:04 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 20:04:29 +0000 (17:04 -0300)
commit4b9b22619008f0829b7f5a8685e7b1d2a9aeb6bb
tree0b5011c51972745586b4f42ecf339d9ac3cda55b
parent56129a5fcbcbe51a7ac7d6b009d4551ed9f71109
Send the end of the view in one part with the task

The first try of a compaction sends the opening tag and each whole block
of four view lines as parts of their own, and then one last part with
the rest of the lines, the closing tag, and the task. The note of a
retry is the part after that. Joined, the parts are the same bytes as
before.

A pair check showed that a compaction whose view shares whole blocks
with an earlier one, but has its own rest part, reads nothing from the
cache, and that an exact repeat does. A rule that fits all results so
far: the ChatGPT backend stores a cache entry for a request without its
last part, and a later request reads it only if it begins with that
whole entry. With the end of the view in the last part, the entry of a
compaction ends at its last whole block, and a later compaction with a
longer view begins with it.

Issue: 8c5fd2a
compactor.go
compactor_test.go