Skip to content

Commit b42430c

Browse files
committed
fix: always redact prompt cache keys in doctor output
1 parent 5efab82 commit b42430c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

lib/ui/beginner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export interface BeginnerAccountSummary {
5353
export function formatPromptCacheKey(value: string | null | undefined): string {
5454
const normalized = value?.trim();
5555
if (!normalized) return "none";
56-
if (normalized.length <= 8) return normalized;
5756
return `${normalized.slice(0, 8)}...`;
5857
}
5958

test/beginner-ui.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ describe("formatPromptCacheKey", () => {
237237
expect(formatPromptCacheKey(" ")).toBe("none");
238238
});
239239

240-
it("keeps short values as-is", () => {
241-
expect(formatPromptCacheKey("ses_1234")).toBe("ses_1234");
240+
it("redacts short values too", () => {
241+
expect(formatPromptCacheKey("ses_1234")).toBe("ses_1234...");
242242
});
243243

244244
it("redacts longer values to an 8-char prefix", () => {

0 commit comments

Comments
 (0)