Skip to content

Commit 932b9d2

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistance] Don't send rpcId for partial answers
This makes sure that we don't show any UI for rating before the answer is complete. Bug: none Change-Id: I62f09390fb384bece9efb220e946b83c7fbec9f9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6037626 Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]>
1 parent 8962d59 commit 932b9d2

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

front_end/panels/freestyler/AiAgent.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ describeWithEnvironment('AiAgent', () => {
356356
{
357357
type: ResponseType.ANSWER,
358358
text: 'Partial ans',
359-
rpcId: undefined,
360359
},
361360
{
362361
type: ResponseType.ANSWER,
@@ -421,7 +420,6 @@ describeWithEnvironment('AiAgent', () => {
421420
{
422421
type: ResponseType.ERROR,
423422
error: ErrorType.UNKNOWN,
424-
rpcId: undefined,
425423
},
426424
]);
427425
});

front_end/panels/freestyler/AiAgent.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export interface AnswerResponse {
3636
export interface ErrorResponse {
3737
type: ResponseType.ERROR;
3838
error: ErrorType;
39-
rpcId?: number;
4039
}
4140

4241
export interface ContextDetail {
@@ -464,7 +463,6 @@ STOP`;
464463
yield {
465464
type: ResponseType.ANSWER,
466465
text: parsedResponse.answer,
467-
rpcId,
468466
};
469467
}
470468
}
@@ -475,7 +473,6 @@ STOP`;
475473
const response = {
476474
type: ResponseType.ERROR,
477475
error: ErrorType.ABORT,
478-
rpcId,
479476
} as const;
480477
this.#addHistory(response);
481478
yield response;
@@ -486,7 +483,6 @@ STOP`;
486483
const response = {
487484
type: ResponseType.ERROR,
488485
error,
489-
rpcId,
490486
} as const;
491487
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceError);
492488
this.#addHistory(response);
@@ -499,7 +495,6 @@ STOP`;
499495
const response = {
500496
type: ResponseType.ERROR,
501497
error: ErrorType.UNKNOWN,
502-
rpcId,
503498
} as const;
504499
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceError);
505500
this.#addHistory(response);
@@ -526,7 +521,6 @@ STOP`;
526521
const response = {
527522
type: ResponseType.ERROR,
528523
error: ErrorType.UNKNOWN,
529-
rpcId,
530524
} as const;
531525
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceError);
532526
this.#addHistory(response);

front_end/panels/freestyler/FreestylerAgent.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,6 @@ STOP`,
928928
const agent = new FreestylerAgent({
929929
aidaClient: mockAidaClient(generateAnswer),
930930
execJs: sinon.spy(),
931-
932931
});
933932

934933
const responses = await Array.fromAsync(agent.run('test', {selected: new Freestyler.NodeContext(element)}));
@@ -952,12 +951,10 @@ STOP`,
952951
query: '# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test',
953952
},
954953
{
955-
rpcId: 123,
956954
text: 'this is the answer',
957955
type: Freestyler.ResponseType.ANSWER,
958956
},
959957
{
960-
rpcId: 123,
961958
type: Freestyler.ResponseType.ERROR,
962959
error: Freestyler.ErrorType.BLOCK,
963960
},
@@ -1088,7 +1085,6 @@ STOP
10881085
{
10891086
type: Freestyler.ResponseType.ERROR,
10901087
error: Freestyler.ErrorType.UNKNOWN,
1091-
rpcId: undefined,
10921088
},
10931089
]);
10941090
sinon.assert.notCalled(execJs);

0 commit comments

Comments
 (0)