Commit a631efe
authored
enhance(cli, config): Support interactive tool mode switching (#372)
Users can now interactively toggle between different run and result
modes when prompted to execute a tool. This allows switching from "Ask"
to "Edit" or "Unattended" modes on the fly, providing better control
over the tool execution flow without restarting the session.
A new skip functionality has been added, allowing users to bypass tool
execution entirely. When skipping, users can optionally provide
reasoning through their configured editor, which is then communicated
back to the assistant to maintain conversation context.
It is now also possible, after seeing the tool call arguments provided
by the LLM, and having the run mode set to "ask", to allow the tool to
run, but modify the response after, even if by default response mode is
set to "Unattended". This allows for providing more context to the LLM
after the tool call, essentially injecting a "user turn" into the
conversation.
Additionally, local tools can now return a structured `Outcome::Error`
to distinguish between transient and permanent failures. A transient
failure is reported back to the LLM for correction, while a permanent
failure stops the conversation and is reported back to the user.
Finally, the CLI now respects the `InlineResults::Off` configuration to
suppress tool result rendering when desired.
---------
Signed-off-by: Jean Mertz <git@jeanmertz.com>1 parent 5544148 commit a631efe
5 files changed
+293
-134
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 170 | + | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
205 | 200 | | |
206 | 201 | | |
207 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
208 | 217 | | |
209 | 218 | | |
210 | 219 | | |
| |||
353 | 362 | | |
354 | 363 | | |
355 | 364 | | |
356 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
357 | 368 | | |
358 | 369 | | |
359 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
875 | 878 | | |
876 | 879 | | |
877 | 880 | | |
| |||
887 | 890 | | |
888 | 891 | | |
889 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
890 | 896 | | |
891 | 897 | | |
892 | 898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
0 commit comments