Compact a waiting worker's session shortly before its prompt cache expires
CI / tests (pull_request) Failing after 3m16s

This commit is contained in:
2026-11-17 13:00:25 +01:00
parent 0aec288e75
commit e60e891251
9 changed files with 186 additions and 5 deletions
+4
View File
@@ -13,6 +13,10 @@ class Tokens:
read: int = 0
output: int = 0
def context(self) -> int:
"""The tokens of the prompt the message answered: its context."""
return self.input + self.write_5m + self.write_1h + self.read
def plus(self, other: "Tokens") -> "Tokens":
return Tokens(*(mine + theirs for mine, theirs in zip(dataclasses.astuple(self), dataclasses.astuple(other))))