Commit aab4bf3
fix(agent): restore write/shell tools on follow-up confirmation turns
is_generation_query() only checked the current user input, so short
follow-up messages like "sure go ahead fix all then" didn't match any
keyword and caused the agent to be built without WriteFileTool,
WriteFilesTool, and ShellTool. The model then tried to call those tools
(they were in conversation history) and got ToolNotFoundError.
Two fixes:
1. Add commonly missing generation verbs to is_generation_query:
fix, update, add, change, modify, edit, configure, setup, patch,
install - these clearly imply file modification intent.
2. Track last_was_generation in ChatSession. For short inputs (< 60
chars) that aren't planning mode, inherit generation mode from the
previous turn so confirmations like "sure", "yes", "go ahead" keep
write/shell tools active.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 749f7a2 commit aab4bf3
3 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
694 | 693 | | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
695 | 700 | | |
696 | 701 | | |
697 | 702 | | |
| |||
1138 | 1143 | | |
1139 | 1144 | | |
1140 | 1145 | | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1141 | 1150 | | |
1142 | 1151 | | |
1143 | 1152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
708 | 720 | | |
709 | 721 | | |
710 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
0 commit comments