Repository navigation
Commit 7163b10
committed
feat(ai): search unsaved buffers, and load the resize tool up front
Two measured changes and one wording correction, all from the A/B runs
recorded in phoenix-pro/unshipped/ai-panel-efficiency-notes.md.
- searchEditorBuffers: regex search over the UNSAVED open files only. Those
are the only files where the model's Grep is wrong — Grep reads disk, and
disk is stale for a buffer the user has edited but not saved. Read/Edit are
already buffer-safe (the agent flushes first); search was the one gap. The
response names the files it covered and tells the model to Grep the rest,
and when nothing is unsaved it says Grep is authoritative and does no work.
Deliberately not a project scan: that would run on the UI thread and re-do
what ripgrep already does off-thread.
- resizeLivePreview is alwaysLoad. Responsive checks are a core use case and
it cost two ToolSearch round-trips every time: same fix, 3 fewer turns,
~10s faster per responsive task.
- Context line names which tools the "unsaved" note applies to. "Unsaved, so
stale on disk" made the model refuse Edit and drive DocumentManager by hand
through execJsInEditor — no edit card, no undo, 4x the cost. Now: "Read and
Edit see the unsaved text as normal; Grep does not, so use
searchEditorBuffers to search these."1 parent eb080ed commit 7163b10
3 files changed
Lines changed: 60 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
1421 | 1425 | | |
1422 | 1426 | | |
1423 | 1427 | | |
| 1428 | + | |
1424 | 1429 | | |
1425 | 1430 | | |
1426 | 1431 | | |
| |||
1442 | 1447 | | |
1443 | 1448 | | |
1444 | 1449 | | |
| 1450 | + | |
1445 | 1451 | | |
1446 | 1452 | | |
1447 | 1453 | | |
| |||
1454 | 1460 | | |
1455 | 1461 | | |
1456 | 1462 | | |
| 1463 | + | |
1457 | 1464 | | |
1458 | 1465 | | |
1459 | 1466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 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 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
164 | 211 | | |
165 | 212 | | |
166 | 213 | | |
| |||
382 | 429 | | |
383 | 430 | | |
384 | 431 | | |
| 432 | + | |
385 | 433 | | |
386 | 434 | | |
387 | 435 | | |
| |||
646 | 694 | | |
647 | 695 | | |
648 | 696 | | |
649 | | - | |
| 697 | + | |
650 | 698 | | |
651 | 699 | | |
652 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2659 | 2659 | | |
2660 | 2660 | | |
2661 | 2661 | | |
| 2662 | + | |
| 2663 | + | |
2662 | 2664 | | |
2663 | 2665 | | |
2664 | 2666 | | |
| |||
0 commit comments