Commit 42a6a40
Store context in AiAgent
The StylingAgent needs to evaluate JS code in the correct execution
context. Before this CL the currently selected element was used both
for determining the execution context, and for evaluating `$0`. This can
be wrong for external requests with cross-proccess iframes, and also if the user selects a different UI element while the conversation is actively running.
Both problems are fixed by keeping the context constant while the
conversation is being executed. Selecting a new element in the UI and
restarting the conversation with a new context still works after this
CL.
Bug: 422019184, 428690606, 419246352
Change-Id: Ica9abdc2e7c165f8b6577817b78cec733620e7a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6687895
Reviewed-by: Alex Rudenko <[email protected]>
Reviewed-by: Ergün Erdoğmuş <[email protected]>
Commit-Queue: Wolfgang Beyer <[email protected]>1 parent f94cf12 commit 42a6a40
File tree
2 files changed
+29
-24
lines changed- front_end/models/ai_assistance/agents
2 files changed
+29
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
272 | 279 | | |
273 | 280 | | |
274 | 281 | | |
| |||
418 | 425 | | |
419 | 426 | | |
420 | 427 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
428 | 436 | | |
429 | 437 | | |
430 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
194 | | - | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
224 | 221 | | |
225 | 222 | | |
226 | | - | |
| 223 | + | |
227 | 224 | | |
228 | 225 | | |
229 | 226 | | |
| |||
640 | 637 | | |
641 | 638 | | |
642 | 639 | | |
643 | | - | |
| 640 | + | |
644 | 641 | | |
645 | 642 | | |
646 | 643 | | |
| |||
0 commit comments