fix: keep suppressed notification names readable (#73)

Co-authored-by: Codex <codex@pikas.tech>
This commit is contained in:
Lyon
2026-06-02 11:16:50 +08:00
committed by GitHub
parent aa0bd64714
commit 0092f55249
3 changed files with 32 additions and 5 deletions
+6 -4
View File
@@ -653,15 +653,17 @@ function suppressedNotificationEvents(summary: SuppressedNotificationSummary): B
payload: {
phase: "codex-app-server-notifications-suppressed",
total: summary.total,
byMethod: sortCountRecord(summary.byMethod),
byItemType: sortCountRecord(summary.byItemType),
methods: countRecordEntries(summary.byMethod, "method"),
itemTypes: countRecordEntries(summary.byItemType, "itemType"),
valuesPrinted: false,
},
}];
}
function sortCountRecord(input: Record<string, number>): JsonRecord {
return Object.fromEntries(Object.entries(input).sort(([left], [right]) => left.localeCompare(right))) as JsonRecord;
function countRecordEntries(input: Record<string, number>, keyName: "method" | "itemType"): JsonRecord[] {
return Object.entries(input)
.sort(([left], [right]) => left.localeCompare(right))
.map(([name, count]) => ({ [keyName]: name, count }) as JsonRecord);
}
function isSuppressedCodexStatusNotification(method: string): boolean {