feat(governance,chat): size a model's chat history by its own window (#2018)

The replay budget was fixed at half of an assumed 128k window, so a small
local model was still handed more history than it accepts.

A model now carries the context window and output limit the published
catalogue gives it, read once into the state directory and cached on
disk. Chat holds its replay to the window minus the reply and an eighth
for the system prompt and tools, and keeps the assumed budget only for a
model the catalogue publishes nothing about.
This commit is contained in:
sam committed 2026-11-26 04:20:11 +11:00
1 parent 8dd28b90be
commit 8bf3ace96b
7 files changed
+139 -10

No files matched your search

+8
View File
@@ -2435,6 +2435,14 @@ components:
class:
readOnly: true
type: string
context_window:
format: int64
readOnly: true
type: integer
max_output_tokens:
format: int64
readOnly: true
type: integer
model:
description: The model's name on the provider
type: string