Loading
Commits on Source 6
-
Matt Cockayne authored
-
Matt Cockayne authored
-
Matt Cockayne authored
-
Matt Cockayne authored
v0.11.0 adds chat.BoundConversation, the seam a provider applies a history policy through, and the conformance case that proves it runs. The case fails on this bump alone — history_policy_applied reports the last request carrying 9 turns with TruncateOldest(2) set. The policy has never been applied here, and until now nothing said so.
-
Matt Cockayne authored
Config.HistoryPolicy has had no effect on this provider since it shipped. A caller setting TruncateOldest(40) got a conversation that grew without bound. Before every request the client now describes its retained turns, passes them through chat.BoundConversation, and rewrites the session from the indices returned. Before every request rather than once per call: the ReAct loop appends a tool request and its results per step, so an entry-time bound never sees the transcript that overflows. All three paths run it — Chat, Ask and the streaming step. Two things are specific to this provider: - The system turn lives in the message list here, not in a separate field. It is configuration rather than conversation, so it is held out of the described set entirely instead of being described and defended. A policy cannot drop what it was never offered. - OpenAI has no per-message cache annotation. It caches eligible prefixes automatically, so there is nothing to read back off a turn: the cached region is a length. AddCached now records it, and those turns are described as Pinned. Rewriting any of that prefix costs every later cache hit. The trailing tool unit is one assistant turn plus every tool turn answering it, because OpenAI sends one tool message per call made. Holding out only the last of them would leave the rest in the described set, where a policy is free to drop them and split the group. Refs chat#13 -