Commit ec15a07
committed
fix: preserve tool alias name in API history for consistent conversation context
When tool aliases are used (e.g., 'edit_file' -> 'search_and_replace'), the alias
name is now preserved and written to API history instead of the canonical name.
This prevents confusion in multi-turn conversations where the model sees a different
tool name in history than what it was told the tool was named.
Changes:
- NativeToolCallParser.ts already stores originalName when alias differs from resolved
- Task.ts now uses originalName (alias) when available for API history1 parent 0c2090c commit ec15a07
File tree
2 files changed
+25
-2
lines changed- src/core
- assistant-message
- task
2 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
| 261 | + | |
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
| |||
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
| 337 | + | |
334 | 338 | | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
| 344 | + | |
340 | 345 | | |
341 | 346 | | |
342 | 347 | | |
| |||
530 | 535 | | |
531 | 536 | | |
532 | 537 | | |
533 | | - | |
| 538 | + | |
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
539 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
540 | 552 | | |
541 | 553 | | |
542 | 554 | | |
| |||
798 | 810 | | |
799 | 811 | | |
800 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
801 | 818 | | |
802 | 819 | | |
803 | 820 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3106 | 3106 | | |
3107 | 3107 | | |
3108 | 3108 | | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
3109 | 3115 | | |
3110 | 3116 | | |
3111 | 3117 | | |
3112 | | - | |
| 3118 | + | |
3113 | 3119 | | |
3114 | 3120 | | |
3115 | 3121 | | |
| |||
0 commit comments