Skip to content

Commit 41244cd

Browse files
OrKoNDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistance] Enable persistent history
Bug: 369303513 Change-Id: I8450c3b25294817b18269d3b3afd7585ed70c48d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6074768 Reviewed-by: Mathias Bynens <[email protected]> Commit-Queue: Mathias Bynens <[email protected]>
1 parent 02121d5 commit 41244cd

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

front_end/panels/ai_assistance/agents/AiAgent.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,7 @@ STOP`;
442442

443443
#addHistory(data: ResponseData): void {
444444
this.#history.push(data);
445-
// Remove condition to store the history in storage
446-
if (isHistoryEnabled()) {
447-
void AiHistoryStorage.instance().upsertHistoryEntry(this.serialized());
448-
}
445+
void AiHistoryStorage.instance().upsertHistoryEntry(this.serialized());
449446
}
450447

451448
async * run(query: string, options: {
@@ -658,17 +655,3 @@ function setDebugFreestylerEnabled(enabled: boolean): void {
658655
}
659656
// @ts-ignore
660657
globalThis.setDebugFreestylerEnabled = setDebugFreestylerEnabled;
661-
662-
export function isHistoryEnabled(): boolean {
663-
return Boolean(localStorage.getItem('persistentHistoryAiAssistance'));
664-
}
665-
666-
function setAiAssistancePersistentHistory(enabled: boolean): void {
667-
if (enabled) {
668-
localStorage.setItem('persistentHistoryAiAssistance', 'true');
669-
} else {
670-
localStorage.removeItem('persistentHistoryAiAssistance');
671-
}
672-
}
673-
// @ts-ignore
674-
globalThis.setAiAssistancePersistentHistory = setAiAssistancePersistentHistory;

front_end/panels/ai_assistance/agents/StylingAgent.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,6 @@ ANSWER: this is the answer`,
12841284
beforeEach(() => {
12851285
mockHostConfig();
12861286
element = sinon.createStubInstance(SDK.DOMModel.DOMNode);
1287-
// @ts-ignore
1288-
setAiAssistancePersistentHistory(true);
12891287
});
12901288

12911289
it('stores history via AiHistoryStorage', async () => {

0 commit comments

Comments
 (0)