initial cost tracking

Signed-off-by: Eason Goodale <easong@openai.com>
This commit is contained in:
Eason Goodale
2025-04-18 03:10:54 -07:00
parent 0d6a98f9af
commit cdc0897a25
11 changed files with 421 additions and 4 deletions

View File

@@ -427,8 +427,14 @@ export default function TerminalChat({
).length;
const contextLeftPercent = useMemo(
() => calculateContextPercentRemaining(items, model),
[items, model],
() =>
calculateContextPercentRemaining(
items,
model,
// static system instructions count towards the context budget too
config.instructions?.length ?? 0,
),
[items, model, config.instructions],
);
return (