Skip to content

Conversation

@tsmithsz
Copy link
Contributor

@tsmithsz tsmithsz commented Apr 15, 2025

Problem

  • fixHistory only processes the first conversation associated with the tab, but there can be multiple. Results in an incomplete history and messes up the history sent in the request
  • We currently delete the entire history for a tab if an exception is thrown. This is not ideal and leads to customer confusion when they are not able to continue using their chat history after an error.
  • Right-click actions like Explain this code fail when preceding message history contains toolResults. Mynah does not recognize this enum
  • Fake messages for tooluse failures are being stored the chat history.

Solution

  • Collect message across all conversation associated with the current tab and consolidate them into a single conversation
  • Remove clearTab() call when exception is thrown
  • Do not include history for requests to Mynah
  • Remove clearRecentHistory as this is no longer used
  • Do not store these fake messages to the chatHistory

Testing

  • Manually tested fixes:
    • Chat history still remains after exception is thrown
    • Mynah no longer throws exception for right-click action following tool execution
      Screenshot 2025-04-15 at 4 51 12 PM

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

@tsmithsz tsmithsz requested review from a team as code owners April 15, 2025 23:42
@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.

@ashishrp-aws
Copy link
Contributor

/retryBuilds

@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch 2 times, most recently from d6e127f to 6cb4dcb Compare April 16, 2025 00:30
@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch 2 times, most recently from 63da6b2 to 3096750 Compare April 16, 2025 20:49
@tsmithsz tsmithsz changed the title fix(amazonq): Don't delete history on exception; Don't include history for requests to Mynah fix(amazonq): Address multiple history bugs Apr 16, 2025
@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch 3 times, most recently from a102557 to f88f496 Compare April 16, 2025 21:43
@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch from f88f496 to 591bbc6 Compare April 16, 2025 21:58
@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch from 591bbc6 to 9dd4523 Compare April 16, 2025 22:13
@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch from 9dd4523 to 4efba3f Compare April 16, 2025 22:27
@zixlin7 zixlin7 merged commit 62f6ac5 into aws:feature/agentic-chat Apr 17, 2025
20 of 22 checks passed
bywang56 pushed a commit to bywang56/aws-toolkit-vscode that referenced this pull request Apr 17, 2025
## Problem
- `fixHistory` only processes the first conversation associated with the
tab, but there can be multiple. Results in an incomplete history and
messes up the history sent in the request
- We currently delete the entire history for a tab if an exception is
thrown. This is not ideal and leads to customer confusion when they are
not able to continue using their chat history after an error.
- Right-click actions like `Explain this code` fail when preceding
message history contains toolResults. Mynah does not recognize this enum
- Fake messages for tooluse failures are being stored the chat history.

## Solution

- Collect message across all conversation associated with the current
tab and consolidate them into a single conversation
- Remove clearTab() call when exception is thrown
- Do not include history for requests to Mynah
- Remove clearRecentHistory as this is no longer used
- Do not store these fake messages to the chatHistory

## Testing
- Manually tested fixes:
    - Chat history still remains after exception is thrown
- Mynah no longer throws exception for right-click action following tool
execution
![Screenshot 2025-04-15 at 4 51
12 PM](https://github.com/user-attachments/assets/58817f2f-0fe0-452b-bb08-457bf95d729b)
    

---


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

5 participants