Commit b26072f
committed
Make the browser tools agree with each other
An audit of the module found the frame-descent bug was one instance of a
pattern: six independent definitions of 'is this editable' and seven of 'what
is focused', disagreeing with each other. A tool refusing what its sibling
accepts on identical page state is invisible at runtime — the agent follows a
snapshot that says one thing into a tool that says another.
- browser_type now accepts role="textbox" like browser_insert_text does. The
snapshot advertises those elements as [textbox] with a ref, so refusing them
meant rejecting exactly what the outline told the model to type into. Both
the native and synthetic paths, and their descendant scans.
- pressKeyOnPage descends shadow roots and frames like every other focus
reader. It was dispatching synthetic keys at the shadow host or <iframe>
element, where they bubble but never reach the editor, while reporting
success — and contradicting the activeElement reported beside it.
- not-editable and ambiguous-editable name what was found: the element's tag
and role, and the candidate fields. Both had the data and discarded it, which
is what turns one blocked step into twenty rounds of guessing.
- obstructedAfterNavigation requires a dialog that ARRIVED with the
navigation. It compared against nothing, so every SPA route change under a
persistent role=dialog reported a successful click as obstructed. The test
that covered this asserted the false positive; it now pins both directions.
- browser_insert_text observes the top document when typing inside a frame,
like every other input tool. A submit that navigates the top page was
invisible to its frame-scoped observation.1 parent 4e6e53d commit b26072f
4 files changed
Lines changed: 186 additions & 22 deletions
File tree
- apps/desktop/src/main/browser-agent
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | | - | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
1664 | 1668 | | |
1665 | 1669 | | |
1666 | 1670 | | |
| |||
1695 | 1699 | | |
1696 | 1700 | | |
1697 | 1701 | | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
1698 | 1743 | | |
1699 | 1744 | | |
1700 | 1745 | | |
1701 | | - | |
1702 | 1746 | | |
1703 | | - | |
1704 | | - | |
| 1747 | + | |
1705 | 1748 | | |
1706 | 1749 | | |
1707 | 1750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
896 | 903 | | |
897 | 904 | | |
898 | 905 | | |
899 | 906 | | |
900 | 907 | | |
901 | 908 | | |
902 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
903 | 914 | | |
904 | | - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
905 | 918 | | |
906 | 919 | | |
907 | 920 | | |
| |||
2344 | 2357 | | |
2345 | 2358 | | |
2346 | 2359 | | |
2347 | | - | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
2348 | 2372 | | |
2349 | 2373 | | |
2350 | | - | |
| 2374 | + | |
2351 | 2375 | | |
2352 | 2376 | | |
2353 | 2377 | | |
| |||
3249 | 3273 | | |
3250 | 3274 | | |
3251 | 3275 | | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
3252 | 3282 | | |
3253 | 3283 | | |
3254 | 3284 | | |
| |||
3275 | 3305 | | |
3276 | 3306 | | |
3277 | 3307 | | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
3278 | 3311 | | |
3279 | 3312 | | |
3280 | 3313 | | |
3281 | 3314 | | |
3282 | | - | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
3283 | 3318 | | |
3284 | 3319 | | |
3285 | 3320 | | |
| |||
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| |||
383 | 386 | | |
384 | 387 | | |
385 | 388 | | |
386 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
387 | 395 | | |
388 | 396 | | |
389 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
| 1045 | + | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
| |||
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | | - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
1254 | 1259 | | |
1255 | 1260 | | |
1256 | 1261 | | |
1257 | 1262 | | |
1258 | 1263 | | |
1259 | 1264 | | |
1260 | 1265 | | |
1261 | | - | |
| 1266 | + | |
1262 | 1267 | | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
1266 | 1271 | | |
1267 | | - | |
1268 | | - | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
1269 | 1294 | | |
1270 | 1295 | | |
1271 | 1296 | | |
| |||
1776 | 1801 | | |
1777 | 1802 | | |
1778 | 1803 | | |
1779 | | - | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1780 | 1810 | | |
1781 | 1811 | | |
1782 | 1812 | | |
1783 | 1813 | | |
1784 | 1814 | | |
1785 | 1815 | | |
1786 | 1816 | | |
1787 | | - | |
| 1817 | + | |
1788 | 1818 | | |
1789 | 1819 | | |
1790 | 1820 | | |
1791 | 1821 | | |
1792 | 1822 | | |
1793 | | - | |
1794 | | - | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
1795 | 1845 | | |
1796 | 1846 | | |
1797 | 1847 | | |
| |||
1873 | 1923 | | |
1874 | 1924 | | |
1875 | 1925 | | |
1876 | | - | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
1877 | 1953 | | |
1878 | 1954 | | |
| 1955 | + | |
| 1956 | + | |
1879 | 1957 | | |
1880 | 1958 | | |
1881 | 1959 | | |
| |||
0 commit comments