Commit 62f6ac5
authored
fix(amazonq): Address multiple history bugs (#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 ed50d42 commit 62f6ac5
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 | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
| |||
753 | 754 | | |
754 | 755 | | |
755 | 756 | | |
| 757 | + | |
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
| |||
844 | 846 | | |
845 | 847 | | |
846 | 848 | | |
| 849 | + | |
847 | 850 | | |
848 | 851 | | |
849 | 852 | | |
| |||
1138 | 1141 | | |
1139 | 1142 | | |
1140 | 1143 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
| |||
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
| 1320 | + | |
1320 | 1321 | | |
1321 | 1322 | | |
1322 | 1323 | | |
| |||
1595 | 1596 | | |
1596 | 1597 | | |
1597 | 1598 | | |
1598 | | - | |
| 1599 | + | |
1599 | 1600 | | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
1603 | 1605 | | |
1604 | 1606 | | |
1605 | 1607 | | |
| |||
1669 | 1671 | | |
1670 | 1672 | | |
1671 | 1673 | | |
| 1674 | + | |
1672 | 1675 | | |
1673 | 1676 | | |
1674 | 1677 | | |
| |||
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 | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
| 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