mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 15:04:58 +00:00
fix: /status shows incorrect context percentage — totalTokens clamped to contextTokens (#15114) (#15133)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: a489669fc7
Co-authored-by: echoVic <16428813+echoVic@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -157,6 +157,7 @@ describe("gateway server sessions", () => {
|
||||
sessions: Array<{
|
||||
key: string;
|
||||
totalTokens?: number;
|
||||
totalTokensFresh?: boolean;
|
||||
thinkingLevel?: string;
|
||||
verboseLevel?: string;
|
||||
lastAccountId?: string;
|
||||
@@ -169,7 +170,8 @@ describe("gateway server sessions", () => {
|
||||
expect(list1.payload?.sessions.some((s) => s.key === "global")).toBe(false);
|
||||
expect(list1.payload?.defaults?.modelProvider).toBe(DEFAULT_PROVIDER);
|
||||
const main = list1.payload?.sessions.find((s) => s.key === "agent:main:main");
|
||||
expect(main?.totalTokens).toBe(30);
|
||||
expect(main?.totalTokens).toBeUndefined();
|
||||
expect(main?.totalTokensFresh).toBe(false);
|
||||
expect(main?.thinkingLevel).toBe("low");
|
||||
expect(main?.verboseLevel).toBe("on");
|
||||
expect(main?.lastAccountId).toBe("work");
|
||||
|
||||
Reference in New Issue
Block a user