Commit 8da5c6e
committed
fix(webview): isolate parallel mode and provider profile writes
Port vps2 F3 (mode/profile writes) from upstream 978, hunk-by-hunk against
the F1c..CS residual:
- ClineProvider: add repointPersistedViewStates() to re-point
currentApiConfigName across per-view entries when a profile is renamed
or replaced, and prune orphaned entries; validate handleModeSwitch slugs
against the custom-modes manager and no-op with a log on unknown modes;
drop the as-any cast in delegateParentAndOpenChild.
- Task: route mode switches through provider.handleModeSwitch(task) and
keep the submitted message on failure instead of setMode().
- SwitchModeTool and specs: durable per-view mode writes.
- webviewMessageHandler: no change vs base - the kimi-code OAuth hunk in
the residual is CS-only divergence (not-ported register item 1), not
part of #978/#979.
- webviewMessageHandler.spec: ported only #979's 4 mock fields +
defaultModeSlug import; the stack-side legacy-repair test, Key-aware
getValue mock and em-dash comment are retained (register item 4).
#979's mode-routing WMH.spec describe ("routes mode messages through
handleModeSwitch instead of writing ContextProxy directly") exists in
neither CS nor the stack and is ported by no unit (open question,
logged).
- Tests: H3/H4 durable handleModeSwitch writes in ClineProvider.spec.ts;
profile-mutation, profile-activation and handleModeSwitch-integration
describes (incl. A4 non-focused-target regression and new
mutation-killing tests) in ClineProvider.parallelMode.spec.ts;
sticky-mode and webviewMessageHandler spec updates; retain the
setViewStateId __proto__ guard + spec test - shipped F1a hardening;
the residual's guard removal is lineage divergence, not F3 content.
- eslint-suppressions.json: no-explicit-any counts decrease for
core/webview/ClineProvider.ts (12 -> 11) and
core/webview/__tests__/ClineProvider.sticky-mode.spec.ts (36 -> 33).
Upstream: #978 (vps2 F3) - issue #978; content ported
hunk-by-hunk from the F1c..CS residual, cross-checked against upstream PR
#979 (stale head e21ff41)1 parent aa0f3b1 commit 8da5c6e
10 files changed
Lines changed: 919 additions & 65 deletions
File tree
- src
- core
- task
- __tests__
- tools
- __tests__
- webview
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1656 | 1656 | | |
1657 | 1657 | | |
1658 | 1658 | | |
1659 | | - | |
1660 | | - | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
1661 | 1675 | | |
1662 | 1676 | | |
1663 | 1677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
1231 | 1234 | | |
1232 | 1235 | | |
1233 | 1236 | | |
| 1237 | + | |
1234 | 1238 | | |
1235 | 1239 | | |
1236 | 1240 | | |
| |||
1786 | 1790 | | |
1787 | 1791 | | |
1788 | 1792 | | |
1789 | | - | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
1790 | 1800 | | |
1791 | 1801 | | |
1792 | 1802 | | |
| |||
1795 | 1805 | | |
1796 | 1806 | | |
1797 | 1807 | | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1798 | 1812 | | |
1799 | 1813 | | |
1800 | 1814 | | |
| |||
1807 | 1821 | | |
1808 | 1822 | | |
1809 | 1823 | | |
1810 | | - | |
| 1824 | + | |
1811 | 1825 | | |
1812 | 1826 | | |
1813 | 1827 | | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1814 | 1852 | | |
1815 | 1853 | | |
1816 | 1854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
59 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
168 | | - | |
169 | | - | |
| 171 | + | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | | - | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
247 | | - | |
| 250 | + | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
| |||
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
306 | | - | |
| 309 | + | |
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
| |||
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
328 | | - | |
| 331 | + | |
329 | 332 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
337 | 342 | | |
338 | | - | |
| 343 | + | |
| 344 | + | |
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
344 | | - | |
345 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
346 | 355 | | |
347 | 356 | | |
348 | 357 | | |
349 | 358 | | |
350 | 359 | | |
351 | | - | |
352 | | - | |
| 360 | + | |
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
| |||
0 commit comments