Skip to content

Conversation

@laileni-aws
Copy link
Contributor

@laileni-aws laileni-aws commented Jun 18, 2025

Problem

  • Missing chatOptions like mcp icon, history icon, export icon in tab bar and quickActions like /clear and /help in the input menu.
    image

Root Cause 1:

  • The CHAT_OPTIONS command is sometimes not properly received by the handleInboundMessage function in the chat client.
  • The root issue was a race condition in the communication between the VSCode extension and the webview component. When the onDidResolveWebview event fired, the code was immediately trying to send a message to the webview, but in some cases, the webview wasn't fully ready to receive messages yet, causing the message to be lost.

Root Cause 2:

  • If user opens a large repository(example: JetBrains) in any IDE(VSC or JB or VS or Ecllipse), IDE takes some time to do indexing.
  • This delay of indexing is stopping the webview to initialize and if the webview is delayed, the chatOptions like quickActions(/help or /clear) and tab bar icons are not sent because of webview delay.

Ideal case:

Solution:

  1. Listen to dedicated aws/chat/ready event, which ensures we only send messages when the UI is fully initialized and ready to process them.
  2. The chat options are stored when initialized, and then sent when the aws/chat/ready event is received from the UI.
  3. Added explicit try/catch around the message sending process with proper error logging.
  4. Added clearer log messages to track the UI ready event and message sending process, which will make debugging easier if issues arise in the future.

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

@laileni-aws laileni-aws marked this pull request as ready for review June 18, 2025 21:57
@laileni-aws laileni-aws requested a review from a team as a code owner June 18, 2025 21:57
@laileni-aws laileni-aws merged commit 89903fe into aws:master Jun 19, 2025
58 of 61 checks passed
laileni-aws added a commit to laileni-aws/aws-toolkit-vscode that referenced this pull request Jun 19, 2025
laileni-aws added a commit that referenced this pull request Jun 19, 2025
## Notes:
- Adding change log for #7520 

---

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

6 participants