Commit b6d44c3
authored
nes: fix: use speculativeRequestDelay for cached speculative results (#4985)
* test: add failing test for cached speculative result using wrong delay
When a speculative request completes and its result is cached before the
user accepts, the subsequent getNextEdit() takes the cache path where
isFromSpeculativeRequest stays false. This causes computeMinimumResponseDelay
to use the normal cacheDelay instead of the speculative-specific
speculativeRequestDelay (typically 0ms).
The test sets cacheDelay=5000ms and speculativeRequestDelay=0ms, then
verifies that a cached speculative result returns fast. Currently it
times out at 5000ms, confirming the bug.
* fix: use speculativeRequestDelay for cached speculative results
When a speculative request completes and caches its result before the
user accepts, the subsequent getNextEdit() takes the cache path. In
this path, isFromSpeculativeRequest was not being set from the cached
edit's source, causing computeMinimumResponseDelay to apply the normal
cacheDelay instead of the speculative-specific speculativeRequestDelay.
Set isFromSpeculativeRequest from cachedEdit.source.isSpeculative in
the cache path so that cached speculative results use the correct
(typically 0ms) delay.1 parent 1522ae8 commit b6d44c3
File tree
2 files changed
+60
-0
lines changed- src/extension/inlineEdits
- node
- test/node
2 files changed
+60
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1314 | 1373 | | |
0 commit comments