Commit 9055491
committed
Fix todo update failures by removing ID from create_todos schema
This fixes two related issues with todo management:
1. "todo X not found" errors when updating todos
- LLMs were providing IDs in create_todos (e.g., "id": "1") because
the schema included an id field
- Backend auto-generates proper IDs (e.g., "todo_1") but LLMs would
later try to update using the wrong ID format
- Solution: Created CreateTodoItem struct without id/status fields
for the create_todos schema, preventing LLM confusion
2. Missing todo update events in TUI
- TUI was updating todos on ToolCall event (before execution)
- If a tool failed, TUI would show the update even though it never
succeeded in the backend
- Solution: Moved todo updates to ToolCallResponse event with error
checking to ensure TUI only updates after successful execution
Changes:
- Add CreateTodoItem struct with only description field
- Update CreateTodosArgs to use CreateTodoItem instead of Todo
- Move TUI todo update logic from ToolCall to ToolCallResponse
- Update tests to match new schema1 parent b413093 commit 9055491
3 files changed
+18
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | | - | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 86 | | |
97 | 87 | | |
98 | 88 | | |
| |||
191 | 181 | | |
192 | 182 | | |
193 | 183 | | |
194 | | - | |
| 184 | + | |
195 | 185 | | |
196 | 186 | | |
197 | 187 | | |
| |||
222 | 212 | | |
223 | 213 | | |
224 | 214 | | |
225 | | - | |
| 215 | + | |
226 | 216 | | |
227 | 217 | | |
228 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
| 251 | + | |
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
250 | | - | |
251 | | - | |
252 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
253 | 260 | | |
254 | 261 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
| |||
0 commit comments