b6989c3eea
List GET no longer ships transcripts; consult appends questions after reserve and ignores client history so dual-tab last-write-wins cannot erase messages. Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
534 B
TypeScript
16 lines
534 B
TypeScript
import { createHash } from "node:crypto";
|
|
import { logAgentObservability } from "@/lib/agent-observability";
|
|
|
|
export function hashedUserId(userId: string): string {
|
|
return createHash("sha256").update(userId).digest("hex").slice(0, 16);
|
|
}
|
|
|
|
export function logIgnoredSessionMessages(sessionId: string, userId: string, messageCount: number): void {
|
|
logAgentObservability({
|
|
sessionId,
|
|
requestId: `compat-${hashedUserId(userId)}`,
|
|
errorCode: "compat_messages_ignored",
|
|
evidenceCount: Math.max(0, messageCount),
|
|
});
|
|
}
|