Skip to content

Conversation

@zixlin7
Copy link
Contributor

@zixlin7 zixlin7 commented Jan 23, 2025

Problem

To support complex recommendations broken into multiple chunks, we need the ability to immediately show user next recommendation when they accept previous one

Solution

pre-fetch next recommendation predicting user accept first recommendation when showing them to user, and if user did accept first recommendation, immediately show next recommendation


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@Will-ShaoHua Will-ShaoHua marked this pull request as ready for review January 31, 2025 23:25
@Will-ShaoHua Will-ShaoHua requested review from a team as code owners January 31, 2025 23:25
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "prefetch next recommendations when possible to reduce suggestion latency"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "prefetch next recommendations when possible to reduce suggestion latency"
"description": "Inline suggestions: Pre-fetch recommendations to reduce suggestion latency."

Comment on lines 21 to 23
describe('onAcceptance', function () {
beforeEach(async function () {
const session = CodeWhispererSessionState.instance.getSession()
Copy link
Contributor

@hayemaxi hayemaxi Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
describe('onAcceptance', function () {
beforeEach(async function () {
const session = CodeWhispererSessionState.instance.getSession()
const session = CodeWhispererSessionState.instance.getSession()
describe('onAcceptance', function () {
beforeEach(async function () {

Does the variable need to be duplicated? Applicable throughout PR (for tests).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that's a good callout, thanks Max

firstSuggestionShowTime = 0
perceivedLatency = 0
// Per-session states
constructor() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just initialize all these directly in the class definition above? It would cut the amount of code in half and still be understandable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea that sounds good tome

@Will-ShaoHua Will-ShaoHua requested a review from hayemaxi February 4, 2025 18:56
Copy link
Contributor

@hayemaxi hayemaxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending CI

@Will-ShaoHua
Copy link
Contributor

fixing CI failure

@Will-ShaoHua Will-ShaoHua merged commit 50c9121 into aws:master Feb 4, 2025
25 of 26 checks passed
evanliu048 added a commit to evanliu048/aws-toolkit-vscode that referenced this pull request Feb 12, 2025
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
…ws#6419)

## Problem
To support complex recommendations broken into multiple chunks, we need
the ability to immediately show user next recommendation when they
accept previous one

## Solution
pre-fetch next recommendation predicting user accept first
recommendation when showing them to user, and if user did accept first
recommendation, immediately show next recommendation

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Will Lo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants