1465 unmodified lines
Expand all
promptCache: {
status: "warm",
cachedTokens: 50_000,
ttlSeconds: 300,
// Two seconds of slack: the label floors to whole seconds, so a render
// that lands a millisecond later reads 3m 59s instead of 4m.
expiresAt: Date.now() + 240_000,
expiresAt: Date.now() + 242_000,
deterministic: true,
},
},
};
fakeThis.uiServices = { getContextUsage: () => undefined };
fakeThis.getCurrentModel = () => undefined;
// The ttl text is derived from the clock, so a slow machine can land a second
// past the four-minute mark; the ratio and the minute are what matter here.
expect(getTrayContextLabel.call(fakeThis)).toMatch(/^50k\/75k cached \(75%\) · ttl 4m(?: \d+s)?$/);
});
test("retains cached ratio and ttl label when agent is streaming", () => {
1331 unmodified lines
Expand all