]> git.giacomolli.uk - onechat/commit
Send the cache key in the session_id header
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 18:36:58 +0000 (15:36 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 18:36:58 +0000 (15:36 -0300)
commitba9faee0cd6c35020997794ef7bf134e8db12e96
treef1d4fafbdd0a23fca6ccc423fddaeb7be8d0f6ba
parent6f7eda727e519ae43d7d35195cbe412a2725abd7
Send the cache key in the session_id header

Each call to the ChatGPT backend sends the cache key of the agent in the
session_id header too, and keeps prompt_cache_key in the body. With the
key in the body only, the probe got no cached token, also on five tries
of one node with the same prefix. The same request sent twice with the
header got 1,664 of 1,756 input tokens from the cache on the second
call. Calls to the OpenAI API do not send the header.

Issue: b14d537
responses.go
responses_test.go