mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
removed mcpCorrelationId
This commit is contained in:
parent
971bad9cb0
commit
16542f1103
@ -97,7 +97,6 @@ export const POST = createSmartRouteHandler({
|
||||
userId: fullReq.auth?.user?.id,
|
||||
requestedToolsJson: JSON.stringify(toolNames),
|
||||
messagesJson: JSON.stringify(messages),
|
||||
mcpCorrelationId: body.mcpCallMetadata ? correlationId : undefined,
|
||||
conversationId: conversationIdForLog,
|
||||
};
|
||||
const startedAt = performance.now();
|
||||
|
||||
@ -46,7 +46,6 @@ export function buildProxyLogRow(fields: ProxyLogFields): AiQueryLogEntry {
|
||||
stepCount: 0,
|
||||
durationMs,
|
||||
errorMessage: responseStatus >= 400 ? `upstream ${responseStatus}` : undefined,
|
||||
mcpCorrelationId: undefined,
|
||||
conversationId: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@ -73,7 +73,6 @@ export type AiQueryLogEntry = {
|
||||
stepCount: number,
|
||||
durationMs: bigint,
|
||||
errorMessage: string | undefined,
|
||||
mcpCorrelationId: string | undefined,
|
||||
conversationId: string | undefined,
|
||||
};
|
||||
|
||||
@ -104,7 +103,6 @@ export async function logAiQuery(entry: AiQueryLogEntry): Promise<void> {
|
||||
sanitizeRequiredNumber("stepCount", entry.stepCount),
|
||||
entry.durationMs,
|
||||
opt(entry.errorMessage),
|
||||
opt(entry.mcpCorrelationId),
|
||||
opt(entry.conversationId),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -34,7 +34,6 @@ export type CommonLogFields = {
|
||||
userId: string | undefined,
|
||||
requestedToolsJson: string,
|
||||
messagesJson: string,
|
||||
mcpCorrelationId: string | undefined,
|
||||
conversationId: string | undefined,
|
||||
};
|
||||
|
||||
|
||||
@ -71,7 +71,6 @@ const aiQueryLog = table(
|
||||
stepCount: t.u32(),
|
||||
durationMs: t.u64(),
|
||||
errorMessage: t.string().optional(),
|
||||
mcpCorrelationId: t.string().optional(),
|
||||
conversationId: t.string().optional(),
|
||||
}
|
||||
);
|
||||
@ -589,7 +588,6 @@ export const log_ai_query = spacetimedb.reducer(
|
||||
stepCount: t.u32(),
|
||||
durationMs: t.u64(),
|
||||
errorMessage: t.string().optional(),
|
||||
mcpCorrelationId: t.string().optional(),
|
||||
conversationId: t.string().optional(),
|
||||
},
|
||||
(ctx, args) => {
|
||||
@ -623,7 +621,6 @@ export const log_ai_query = spacetimedb.reducer(
|
||||
stepCount: args.stepCount,
|
||||
durationMs: args.durationMs,
|
||||
errorMessage: args.errorMessage,
|
||||
mcpCorrelationId: args.mcpCorrelationId,
|
||||
conversationId: args.conversationId,
|
||||
} as Parameters<typeof ctx.db.aiQueryLog.insert>[0]);
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@ export function Usage({ rows, connectionState, onSelect, selectedId }: Props) {
|
||||
<span className="inline-flex px-1.5 py-0.5 rounded bg-purple-100 text-purple-800 font-mono text-[10px]">
|
||||
{row.systemPromptId}
|
||||
</span>
|
||||
{row.mcpCorrelationId != null && (
|
||||
{row.conversationId != null && (
|
||||
<span className="ml-1 inline-flex px-1 py-0.5 rounded bg-amber-100 text-amber-800 text-[9px]">MCP</span>
|
||||
)}
|
||||
{!row.isAuthenticated && (
|
||||
|
||||
@ -91,7 +91,7 @@ export function UsageDetail({ row, onClose }: { row: AiQueryLogRow, onClose: ()
|
||||
{isError && (
|
||||
<span className="inline-flex px-1.5 py-0.5 rounded bg-red-100 text-red-700 text-[10px]">error</span>
|
||||
)}
|
||||
{row.mcpCorrelationId != null && (
|
||||
{row.conversationId != null && (
|
||||
<span className="inline-flex px-1.5 py-0.5 rounded bg-amber-100 text-amber-800 text-[10px]">MCP</span>
|
||||
)}
|
||||
</div>
|
||||
@ -142,7 +142,6 @@ export function UsageDetail({ row, onClose }: { row: AiQueryLogRow, onClose: ()
|
||||
{row.projectId && <MetaRow label="Project" value={row.projectId} />}
|
||||
{row.userId && <MetaRow label="User" value={row.userId} />}
|
||||
{row.conversationId && <MetaRow label="Conversation" value={row.conversationId} />}
|
||||
{row.mcpCorrelationId && <MetaRow label="MCP Correlation" value={row.mcpCorrelationId} />}
|
||||
<MetaRow label="Steps" value={String(row.stepCount)} />
|
||||
<MetaRow label="Tools requested" value={requestedTools.length > 0 ? requestedTools.join(", ") : "—"} />
|
||||
</div>
|
||||
|
||||
@ -35,6 +35,5 @@ export default {
|
||||
stepCount: __t.u32(),
|
||||
durationMs: __t.u64(),
|
||||
errorMessage: __t.option(__t.string()),
|
||||
mcpCorrelationId: __t.option(__t.string()),
|
||||
conversationId: __t.option(__t.string()),
|
||||
};
|
||||
|
||||
@ -37,6 +37,5 @@ export default __t.row({
|
||||
stepCount: __t.u32().name("step_count"),
|
||||
durationMs: __t.u64().name("duration_ms"),
|
||||
errorMessage: __t.option(__t.string()).name("error_message"),
|
||||
mcpCorrelationId: __t.option(__t.string()).name("mcp_correlation_id"),
|
||||
conversationId: __t.option(__t.string()).name("conversation_id"),
|
||||
});
|
||||
|
||||
@ -37,7 +37,6 @@ export const AiQueryLog = __t.object("AiQueryLog", {
|
||||
stepCount: __t.u32(),
|
||||
durationMs: __t.u64(),
|
||||
errorMessage: __t.option(__t.string()),
|
||||
mcpCorrelationId: __t.option(__t.string()),
|
||||
conversationId: __t.option(__t.string()),
|
||||
});
|
||||
export type AiQueryLog = __Infer<typeof AiQueryLog>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user