Skip to content

Conversation

@Hweinstock
Copy link
Contributor

Problem

Response errors returned by the LSP are returned to chat after prepending a custom error message. We can remove this custom error message and rely on flare for a single implementation of this error message.

Solution

  • perform a sanity check on the response before casting it to the proper type.
  • log the last result from the language server to help debug.
  • include the requestId clearly in the logs.
image
  • 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 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.

const errorResult: ChatResult = {
...lastPartialResult,
body,
const errorMsg = `Error occurred during chat request: ${e}`
Copy link
Contributor

@jpinkney-aws jpinkney-aws Apr 25, 2025

Choose a reason for hiding this comment

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

yeah maybe it does make more sense to just put this on client side, it's really not much extra code and it looks like it makes the error handling contract a lot easier to work with

@Hweinstock Hweinstock marked this pull request as ready for review April 25, 2025 13:50
@Hweinstock Hweinstock requested a review from a team as a code owner April 25, 2025 13:50
@jpinkney-aws jpinkney-aws merged commit 1e45112 into aws:feature/hybridChat Apr 25, 2025
31 of 37 checks passed
jpinkney-aws pushed a commit to aws/language-servers that referenced this pull request Apr 25, 2025
## Problem
- Some follow up work from #1115. 

## Solution
- Follow the LSP paradigm to return response error to the client, and handle it there. 
- This is in combination with client side changes [here](aws/aws-toolkit-vscode#7161). 
- These together produce the following experience on model api failures.
@justinmk3
Copy link
Contributor

Is this related to aws/language-servers#1115 ?

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