]> git.giacomolli.uk - onechat/commit
Give each subagent its own prompt cache key
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 14:13:11 +0000 (11:13 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 14:13:11 +0000 (11:13 -0300)
commitcb514b662bcf9d90b2cf02789c989f777d774d3f
tree8c6fcbe9c454e01d73fda6f351469f26dfb05896
parent37d5f21b23da5fbd6b44fed41f653927669571ed
Give each subagent its own prompt cache key

A call of a subagent sends the cache key of the agent with "-" and the
name of the subagent, in the body and in the session_id header. With the
key of the agent, the second request of a subagent in a live check read
0 of 4,435 input tokens from the prompt cache, although it starts with
the whole first request, while the agent made calls with the same key at
the same time. With its own key, the second request of a subagent in the
same check read 4,608 of 4,761 tokens from the cache. The calls of the
agent keep the key of the agent.

Issue: b1ac698
model.go
model_test.go