Commit 3a5d085
fix(amazonq): Address multiple history bugs (aws#7059)
## 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

---
- 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.1 parent 2dc850b commit 3a5d085
File tree
6 files changed
+51
-56
lines changed- packages/core/src
- codewhispererChat/controllers/chat
- messenger
6 files changed
+51
-56
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| 760 | + | |
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
| |||
766 | 767 | | |
767 | 768 | | |
768 | 769 | | |
| 770 | + | |
769 | 771 | | |
770 | 772 | | |
771 | 773 | | |
| |||
857 | 859 | | |
858 | 860 | | |
859 | 861 | | |
| 862 | + | |
860 | 863 | | |
861 | 864 | | |
862 | 865 | | |
| |||
1151 | 1154 | | |
1152 | 1155 | | |
1153 | 1156 | | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
| 1333 | + | |
1333 | 1334 | | |
1334 | 1335 | | |
1335 | 1336 | | |
| |||
1608 | 1609 | | |
1609 | 1610 | | |
1610 | 1611 | | |
1611 | | - | |
| 1612 | + | |
1612 | 1613 | | |
1613 | | - | |
1614 | | - | |
1615 | | - | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1616 | 1618 | | |
1617 | 1619 | | |
1618 | 1620 | | |
| |||
1682 | 1684 | | |
1683 | 1685 | | |
1684 | 1686 | | |
| 1687 | + | |
1685 | 1688 | | |
1686 | 1689 | | |
1687 | 1690 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 149 | | |
160 | 150 | | |
161 | 151 | | |
| |||
170 | 160 | | |
171 | 161 | | |
172 | 162 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 163 | | |
202 | 164 | | |
203 | 165 | | |
| |||
348 | 310 | | |
349 | 311 | | |
350 | 312 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
355 | 318 | | |
356 | 319 | | |
357 | | - | |
| 320 | + | |
358 | 321 | | |
359 | 322 | | |
360 | 323 | | |
| |||
371 | 334 | | |
372 | 335 | | |
373 | 336 | | |
374 | | - | |
375 | | - | |
| 337 | + | |
376 | 338 | | |
377 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
378 | 343 | | |
379 | 344 | | |
380 | 345 | | |
| |||
387 | 352 | | |
388 | 353 | | |
389 | 354 | | |
390 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
391 | 363 | | |
392 | 364 | | |
393 | 365 | | |
394 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
395 | 382 | | |
396 | 383 | | |
397 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
0 commit comments