Skip to content

Commit bde807c

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistance] Don't log structure logs
We should only write to localStorage in debugMode Fixed: 394547977 Change-Id: I6b2f953aaec8bba1d2b493018f805520b5e8ec25 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6235028 Commit-Queue: Alex Rudenko <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]>
1 parent 60fd37d commit bde807c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

front_end/panels/ai_assistance/agents/AiAgent.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,14 @@ export abstract class AiAgent<T> {
475475
request,
476476
response: aidaResponse,
477477
});
478-
479-
this.#structuredLog.push({
480-
request: structuredClone(request),
481-
response,
482-
aidaResponse,
483-
});
484-
localStorage.setItem('freestylerStructuredLog', JSON.stringify(this.#structuredLog));
478+
if (isDebugMode()) {
479+
this.#structuredLog.push({
480+
request: structuredClone(request),
481+
response,
482+
aidaResponse,
483+
});
484+
localStorage.setItem('freestylerStructuredLog', JSON.stringify(this.#structuredLog));
485+
}
485486
}
486487

487488
buildRequest(part: Host.AidaClient.Part, role: Host.AidaClient.Role.USER|Host.AidaClient.Role.ROLE_UNSPECIFIED):

0 commit comments

Comments
 (0)