Merge 882ab886682551b6bc45b6a4f729d5390a3773aa into 6b4c24c2e55b5b4013277bd799525086f6a0c40f

This commit is contained in:
maweibin 2026-03-21 12:40:43 +08:00 committed by GitHub
commit ca65142e0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ function createProps(overrides: Partial<ChatProps> = {}): ChatProps {
key: "main",
kind: "direct",
updatedAt: null,
inputTokens: 3_800,
totalTokens: 3_800,
contextTokens: 4_000,
},
],

View File

@ -255,7 +255,8 @@ function renderContextNotice(
session: GatewaySessionRow | undefined,
defaultContextTokens: number | null,
) {
const used = session?.inputTokens ?? 0;
// Use the same notion as `session_status`: the fresh totalTokens
const used = session?.totalTokens ?? 0;
const limit = session?.contextTokens ?? defaultContextTokens ?? 0;
if (!used || !limit) {
return nothing;