chore: remove tokenlens and token usage tracking (#1357)

This commit is contained in:
josh 2025-12-15 16:56:10 +00:00 committed by GitHub
parent 5f9e231788
commit 7942e97095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 60 additions and 773 deletions

View file

@ -17,7 +17,6 @@ import postgres from "postgres";
import type { ArtifactKind } from "@/components/artifact";
import type { VisibilityType } from "@/components/visibility-selector";
import { ChatSDKError } from "../errors";
import type { AppUsage } from "../usage";
import { generateUUID } from "../utils";
import {
type Chat,
@ -502,21 +501,17 @@ export async function updateChatVisibilityById({
}
}
export async function updateChatLastContextById({
export async function updateChatTitleById({
chatId,
context,
title,
}: {
chatId: string;
// Store merged server-enriched usage object
context: AppUsage;
title: string;
}) {
try {
return await db
.update(chat)
.set({ lastContext: context })
.where(eq(chat.id, chatId));
return await db.update(chat).set({ title }).where(eq(chat.id, chatId));
} catch (error) {
console.warn("Failed to update lastContext for chat", chatId, error);
console.warn("Failed to update title for chat", chatId, error);
return;
}
}