Skip to content

Conversation

@atonaamz
Copy link
Contributor

@atonaamz atonaamz commented Jul 3, 2025

Problem

If it is an EDITS suggestion, only fetching for more suggestions when the user start to accept a suggestion. We need to pass partialResultToken to provideInlineCompletionItems method to fetch result from cache.

Solution

passing partialResultToken for the next trigger if user accepts an EDITS suggestion


  • 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.

@atonaamz atonaamz requested a review from a team as a code owner July 3, 2025 23:54
@atonaamz atonaamz changed the title feat: passing partialResultToken for the next trigger if user accepts an EDITS suggestion feat(amazonq): passing partialResultToken for the next trigger if user accepts an EDITS suggestion Jul 3, 2025
@github-actions
Copy link

github-actions bot commented Jul 3, 2025

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • 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.

@atonaamz atonaamz closed this Jul 3, 2025
@atonaamz atonaamz reopened this Jul 3, 2025
@atonaamz atonaamz force-pushed the nep-flare branch 4 times, most recently from 993e88c to 4b3da66 Compare July 7, 2025 18:23
@atonaamz
Copy link
Contributor Author

atonaamz commented Jul 7, 2025

/retryBuilds

@Will-ShaoHua
Copy link
Contributor

/retryBuilds

languageClient.warn(`Error when getting suggestions: ${error}`)
} else {
// save editsStreakPartialResultToken for the next EDITS suggestion trigger if user accepts
this.sessionManager.updateActiveEditsStreakToken(result.partialResultToken)
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes the first result is an edit, but the check on line 120 is just for at one edit anywhere in the results. Is there some undocumented assumption here about how the results are returned? Even if there is, there should be checks in code that the assumptions hold.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can only return either EDITS or COMPLETIONS so if one item is EDITS, we should follow the EDITS flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@atonaamz atonaamz merged commit a98330d into aws:master Jul 7, 2025
31 checks passed
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