From b305922a5bb77fc7f561594e6d0cb4d02db4117b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E5=85=AE?= Date: Fri, 12 Jun 2026 05:57:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E7=95=99=20Agent=20token=20?= =?UTF-8?q?=E4=BC=B0=E7=AE=97=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/agent/agent-invocation.repository.ts: 脱敏 Agent 调用输入时保留 tokenEstimate 数字,避免 Prisma 写入失败 --- src/agent/agent-invocation.repository.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/agent/agent-invocation.repository.ts b/src/agent/agent-invocation.repository.ts index 0c8179c..fd4fb6c 100644 --- a/src/agent/agent-invocation.repository.ts +++ b/src/agent/agent-invocation.repository.ts @@ -139,7 +139,15 @@ export class AgentInvocationRepository { private sanitizeInput( input: CreateAgentInvocationRecordInput, ): CreateAgentInvocationRecordInput { - return redactSensitive(input); + const redacted = redactSensitive({ + ...input, + tokenEstimate: undefined, + }); + + return { + ...redacted, + tokenEstimate: input.tokenEstimate, + }; } private inputDigest(